From af881a8fe44c94fe6adaaf1409105d18837fe5db Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Tue, 12 Mar 2024 19:13:14 +0100 Subject: [PATCH] limit mux to connection base outbounds --- web/assets/js/model/outbound.js | 6 +++++- web/html/xui/form/outbound.html | 30 ++++++++++++++++-------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js index aa169893..094db564 100644 --- a/web/assets/js/model/outbound.js +++ b/web/assets/js/model/outbound.js @@ -480,7 +480,7 @@ class Mux extends CommonClass { static fromJson(json = {}) { if (Object.keys(json).length === 0) return undefined; - return new SockoptStreamSettings( + return new Mux( json.enabled, json.concurrency, json.xudpConcurrency, @@ -548,6 +548,10 @@ class Outbound extends CommonClass { return [Protocols.VMess, Protocols.VLESS, Protocols.Trojan, Protocols.Shadowsocks].includes(this.protocol); } + canEnableMux() { + return [Protocols.VMess, Protocols.VLESS, Protocols.Trojan, Protocols.Shadowsocks, Protocols.HTTP, Protocols.Socks].includes(this.protocol); + } + hasVnext() { return [Protocols.VMess, Protocols.VLESS].includes(this.protocol); } diff --git a/web/html/xui/form/outbound.html b/web/html/xui/form/outbound.html index 9955c330..e52df4a4 100644 --- a/web/html/xui/form/outbound.html +++ b/web/html/xui/form/outbound.html @@ -431,21 +431,23 @@ - - - -