diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js
index f67528c2..83ef7af3 100644
--- a/web/assets/js/model/outbound.js
+++ b/web/assets/js/model/outbound.js
@@ -441,18 +441,49 @@ class StreamSettings extends CommonClass {
}
}
+class Mux extends CommonClass {
+ constructor(enabled = false, concurrency = 8, xudpConcurrency = 16, xudpProxyUDP443 = "reject") {
+ super();
+ this.enabled = enabled;
+ this.concurrency = concurrency;
+ this.xudpConcurrency = xudpConcurrency;
+ this.xudpProxyUDP443 = xudpProxyUDP443;
+ }
+
+ static fromJson(json = {}) {
+ if (Object.keys(json).length === 0) return undefined;
+ return new SockoptStreamSettings(
+ json.enabled,
+ json.concurrency,
+ json.xudpConcurrency,
+ json.xudpProxyUDP443,
+ );
+ }
+
+ toJson() {
+ return {
+ enabled: this.enabled,
+ concurrency: this.concurrency,
+ xudpConcurrency: this.xudpConcurrency,
+ xudpProxyUDP443: this.xudpProxyUDP443,
+ };
+ }
+}
+
class Outbound extends CommonClass {
constructor(
tag='',
protocol=Protocols.VMess,
settings=null,
streamSettings = new StreamSettings(),
+ mux = new Mux(),
) {
super();
this.tag = tag;
this._protocol = protocol;
this.settings = settings == null ? Outbound.Settings.getSettings(protocol) : settings;
this.stream = streamSettings;
+ this.mux = mux;
}
get protocol() {
@@ -517,6 +548,7 @@ class Outbound extends CommonClass {
json.protocol,
Outbound.Settings.fromJson(json.protocol, json.settings),
StreamSettings.fromJson(json.streamSettings),
+ Mux.fromJson(json.mux),
)
}
@@ -526,6 +558,7 @@ class Outbound extends CommonClass {
protocol: this.protocol,
settings: this.settings instanceof CommonClass ? this.settings.toJson() : this.settings,
streamSettings: this.canEnableStream() ? this.stream.toJson() : undefined,
+ mux: this.mux?.enabled ? this.mux : undefined,
};
}
@@ -581,7 +614,6 @@ class Outbound extends CommonClass {
json.allowInsecure);
}
-
return new Outbound(json.ps, Protocols.VMess, new Outbound.VmessSettings(json.add, json.port, json.id), stream);
}
diff --git a/web/html/xui/form/outbound.html b/web/html/xui/form/outbound.html
index 46b84d73..d7da9255 100644
--- a/web/html/xui/form/outbound.html
+++ b/web/html/xui/form/outbound.html
@@ -413,6 +413,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[ c ]]
+
+
+
+