diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua index 8bdc19960..1872017f1 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua @@ -574,8 +574,23 @@ o = s:option(Value, option_name("splithttp_path"), translate("SplitHTTP Path")) o.placeholder = "/" o:depends({ [option_name("transport")] = "splithttp" }) --- [[ Mux ]]-- -o = s:option(Flag, option_name("mux"), translate("Mux")) +o = s:option(Flag, option_name("splithttp_xmux"), "XMUX", translate("Enable SplitHTTP XMUX. It's not recommended to enable Mux.Cool at the same time.")) +o:depends({ [option_name("transport")] = "splithttp" }) + +o = s:option(Value, option_name("maxConcurrency"), translate("XMUX Max Concurrency")) +o:depends({ [option_name("splithttp_xmux")] = true }) + +o = s:option(Value, option_name("maxConnections"), translate("XMUX Max Connections")) +o:depends({ [option_name("splithttp_xmux")] = true }) + +o = s:option(Value, option_name("cMaxReuseTimes"), translate("XMUX Connection Max Reuse Times")) +o:depends({ [option_name("splithttp_xmux")] = true }) + +o = s:option(Value, option_name("cMaxLifetimeMs"), translate("XMUX Connection Max Lifetime (ms)")) +o:depends({ [option_name("splithttp_xmux")] = true }) + +-- [[ Mux.Cool ]]-- +o = s:option(Flag, option_name("mux"), "Mux", translate("Enable Mux.Cool")) o:depends({ [option_name("protocol")] = "vmess" }) o:depends({ [option_name("protocol")] = "vless", [option_name("flow")] = "" }) o:depends({ [option_name("protocol")] = "http" }) @@ -588,7 +603,7 @@ o.default = 8 o:depends({ [option_name("mux")] = true }) -- [[ XUDP Mux ]]-- -o = s:option(Flag, option_name("xmux"), translate("xMux")) +o = s:option(Flag, option_name("xmux"), "XUDP Mux") o.default = 1 o:depends({ [option_name("protocol")] = "vless", [option_name("flow")] = "xtls-rprx-vision" }) diff --git a/luci-app-passwall/luasrc/passwall/util_xray.lua b/luci-app-passwall/luasrc/passwall/util_xray.lua index 4a2ef63e0..b07657589 100644 --- a/luci-app-passwall/luasrc/passwall/util_xray.lua +++ b/luci-app-passwall/luasrc/passwall/util_xray.lua @@ -288,6 +288,18 @@ function gen_outbound(flag, node, tag, proxy_table) result.streamSettings.tlsSettings.alpn = alpn end end + + local xmux = {} + if node.splithttp_xmux then + xmux.maxConcurrency = node.maxConcurrency and (string.find(node.maxConcurrency, "-") and node.maxConcurrency or tonumber(node.maxConcurrency)) or 0 + xmux.maxConnections = node.maxConnections and (string.find(node.maxConnections, "-") and node.maxConnections or tonumber(node.maxConnections)) or 0 + xmux.cMaxReuseTimes = node.cMaxReuseTimes and (string.find(node.cMaxReuseTimes, "-") and node.cMaxReuseTimes or tonumber(node.cMaxReuseTimes)) or 0 + xmux.cMaxLifetimeMs = node.cMaxLifetimeMs and (string.find(node.cMaxLifetimeMs, "-") and node.cMaxLifetimeMs or tonumber(node.cMaxLifetimeMs)) or 0 + if result.streamSettings.splithttpSettings then + result.streamSettings.splithttpSettings.xmux = xmux + end + end + end return result end diff --git a/luci-app-passwall/po/zh-cn/passwall.po b/luci-app-passwall/po/zh-cn/passwall.po index da6f05a1f..34f991d98 100644 --- a/luci-app-passwall/po/zh-cn/passwall.po +++ b/luci-app-passwall/po/zh-cn/passwall.po @@ -1519,6 +1519,24 @@ msgstr "客户端文件不适合当前设备。" msgid "Can't move new file to path: %s" msgstr "无法移动新文件到:%s" +msgid "Enable SplitHTTP XMUX. It's not recommended to enable Mux.Cool at the same time." +msgstr "启用 SplitHTTP XMUX。不建议与 Mux.Cool 同时启用。" + +msgid "XMUX Max Concurrency" +msgstr "XMUX 连接最大复用流数" + +msgid "XMUX Max Connections" +msgstr "XMUX 最大连接数" + +msgid "XMUX Connection Max Reuse Times" +msgstr "XMUX 连接最多复用次数" + +msgid "XMUX Connection Max Lifetime (ms)" +msgstr "XMUX 连接最大存活时间(ms)" + +msgid "Enable Mux.Cool" +msgstr "启用 Mux.Cool" + msgid "Mux concurrency" msgstr "最大并发连接数"