From a1961edac1b9ed3e7f69db24e35ad3aa16fbd956 Mon Sep 17 00:00:00 2001 From: xiaorouji <60100640+xiaorouji@users.noreply.github.com> Date: Mon, 19 Feb 2024 23:17:46 +0800 Subject: [PATCH] luci: add Xray `mptcp` option support --- .../luasrc/model/cbi/passwall/client/type/ray.lua | 7 +++++++ luci-app-passwall/luasrc/passwall/util_xray.lua | 4 +++- luci-app-passwall/po/zh-cn/passwall.po | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) 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 a99027b60..84096b07f 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 @@ -514,4 +514,11 @@ o = s:option(Value, option_name("xudp_concurrency"), translate("XUDP Mux concurr o.default = 8 o:depends({ [option_name("xmux")] = true }) +--[[tcpMptcp]] +o = s:option(Flag, option_name("tcpMptcp"), "tcpMptcp", translate("Enable Multipath TCP, need to be enabled in both server and client configuration.")) +o.default = 0 + +o = s:option(Flag, option_name("tcpNoDelay"), "tcpNoDelay") +o.default = 0 + api.luci_types(arg[1], m, s, type_name, option_prefix) diff --git a/luci-app-passwall/luasrc/passwall/util_xray.lua b/luci-app-passwall/luasrc/passwall/util_xray.lua index 229b014b0..ade9f8caa 100644 --- a/luci-app-passwall/luasrc/passwall/util_xray.lua +++ b/luci-app-passwall/luasrc/passwall/util_xray.lua @@ -130,7 +130,9 @@ function gen_outbound(flag, node, tag, proxy_table) -- 底层传输配置 streamSettings = (node.streamSettings or node.protocol == "vmess" or node.protocol == "vless" or node.protocol == "socks" or node.protocol == "shadowsocks" or node.protocol == "trojan") and { sockopt = { - mark = 255 + mark = 255, + tcpMptcp = (node.tcpMptcp == "1") and true or nil, + tcpNoDelay = (node.tcpNoDelay == "1") and true or nil, }, network = node.transport, security = node.stream_security, diff --git a/luci-app-passwall/po/zh-cn/passwall.po b/luci-app-passwall/po/zh-cn/passwall.po index 1a59200a7..4a2455abb 100644 --- a/luci-app-passwall/po/zh-cn/passwall.po +++ b/luci-app-passwall/po/zh-cn/passwall.po @@ -1536,3 +1536,6 @@ msgstr "后量子对等证书签名方案" msgid "Disable adaptive sizing of TLS records" msgstr "禁用 TLS 记录的自适应大小调整" + +msgid "Enable Multipath TCP, need to be enabled in both server and client configuration." +msgstr "启用 Multipath TCP,需在服务端和客户端配置中同时启用。"