diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js
index ef586cf1..77e8b2f0 100644
--- a/web/assets/js/model/outbound.js
+++ b/web/assets/js/model/outbound.js
@@ -426,7 +426,8 @@ class HysteriaStreamSettings extends CommonClass {
up = '0',
down = '0',
udphopPort = '',
- udphopInterval = 30,
+ udphopIntervalMin = 30,
+ udphopIntervalMax = 30,
initStreamReceiveWindow = 8388608,
maxStreamReceiveWindow = 8388608,
initConnectionReceiveWindow = 20971520,
@@ -442,7 +443,8 @@ class HysteriaStreamSettings extends CommonClass {
this.up = up;
this.down = down;
this.udphopPort = udphopPort;
- this.udphopInterval = udphopInterval;
+ this.udphopIntervalMin = udphopIntervalMin;
+ this.udphopIntervalMax = udphopIntervalMax;
this.initStreamReceiveWindow = initStreamReceiveWindow;
this.maxStreamReceiveWindow = maxStreamReceiveWindow;
this.initConnectionReceiveWindow = initConnectionReceiveWindow;
@@ -454,10 +456,17 @@ class HysteriaStreamSettings extends CommonClass {
static fromJson(json = {}) {
let udphopPort = '';
- let udphopInterval = 30;
+ let udphopIntervalMin = 30;
+ let udphopIntervalMax = 30;
if (json.udphop) {
udphopPort = json.udphop.port || '';
- udphopInterval = json.udphop.interval || 30;
+ if (json.udphop.interval !== undefined) {
+ udphopIntervalMin = json.udphop.interval;
+ udphopIntervalMax = json.udphop.interval;
+ } else {
+ udphopIntervalMin = json.udphop.intervalMin || 30;
+ udphopIntervalMax = json.udphop.intervalMax || 30;
+ }
}
return new HysteriaStreamSettings(
json.version,
@@ -466,7 +475,8 @@ class HysteriaStreamSettings extends CommonClass {
json.up,
json.down,
udphopPort,
- udphopInterval,
+ udphopIntervalMin,
+ udphopIntervalMax,
json.initStreamReceiveWindow,
json.maxStreamReceiveWindow,
json.initConnectionReceiveWindow,
@@ -495,7 +505,8 @@ class HysteriaStreamSettings extends CommonClass {
if (this.udphopPort) {
result.udphop = {
port: this.udphopPort,
- interval: this.udphopInterval
+ intervalMin: this.udphopIntervalMin,
+ intervalMax: this.udphopIntervalMax
};
}
return result;
@@ -1026,8 +1037,14 @@ class Outbound extends CommonClass {
stream.hysteria.up = urlParams.get('up') ?? '0';
stream.hysteria.down = urlParams.get('down') ?? '0';
stream.hysteria.udphopPort = urlParams.get('mport') ?? urlParams.get('udphopPort') ?? '';
- stream.hysteria.udphopInterval = parseInt(urlParams.get('udphopInterval') ?? '30');
-
+ if (urlParams.has('udphopInterval')) {
+ const interval = parseInt(urlParams.get('udphopInterval'));
+ stream.hysteria.udphopIntervalMin = interval;
+ stream.hysteria.udphopIntervalMax = interval;
+ } else {
+ stream.hysteria.udphopIntervalMin = parseInt(urlParams.get('udphopIntervalMin') ?? '30');
+ stream.hysteria.udphopIntervalMax = parseInt(urlParams.get('udphopIntervalMax') ?? '30');
+ }
if (urlParams.has('initStreamReceiveWindow')) {
stream.hysteria.initStreamReceiveWindow = parseInt(urlParams.get('initStreamReceiveWindow'));
}
diff --git a/web/html/xui/form/outbound.html b/web/html/xui/form/outbound.html
index 50ad731c..52882e5e 100644
--- a/web/html/xui/form/outbound.html
+++ b/web/html/xui/form/outbound.html
@@ -450,11 +450,17 @@
-
+
+ v-model.number="outbound.stream.hysteria.udphopIntervalMin"
+ :min="5">
+
+
+