From dca004f3ed83e4eb4b18bc902086a7583b8a5e65 Mon Sep 17 00:00:00 2001 From: gitea-action Date: Thu, 23 Jan 2025 17:00:16 +0800 Subject: [PATCH] luci-app-ssr-plus: sync upstream last commit: https://github.com/fw876/helloworld/commit/547daf584e8856ec6c6f968f565dbcdb0cdb0f2b --- .../model/cbi/shadowsocksr/client-config.lua | 71 +++++++++++++++---- .../luasrc/view/shadowsocksr/ssrurl.htm | 13 +++- luci-app-ssr-plus/po/zh_Hans/ssr-plus.po | 33 ++++++++- .../usr/share/shadowsocksr/gen_config.lua | 16 +++-- patch-luci-app-ssr-plus.patch | 14 ++-- 5 files changed, 116 insertions(+), 31 deletions(-) diff --git a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua b/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua index 5504de197..3db565373 100644 --- a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua +++ b/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua @@ -434,7 +434,7 @@ o:depends("type", "shadowtls") o.default = "1" o.rmempty = false -o = s:option(Flag, "fastopen", translate("TCP Fast Open")) +o = s:option(Flag, "fastopen", translate("TCP Fast Open"), translate("Enabling TCP Fast Open Requires Server Support.")) o:depends("type", "shadowtls") o.default = "0" o.rmempty = false @@ -735,8 +735,8 @@ o.rmempty = true o = s:option(Flag, "enable_xhttp_extra", translate("XHTTP Extra")) o.description = translate("Enable this option to configure XHTTP Extra (JSON format).") +o.rmempty = true o.default = "0" -o.rmempty = false o:depends("transport", "xhttp") o = s:option(TextValue, "xhttp_extra", " ") @@ -1008,6 +1008,19 @@ if is_finded("xray") then o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "raw", tls = true}) o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "raw", reality = true}) + o = s:option(ListValue, "xhttp_tls_flow", translate("Flow")) + for _, v in ipairs(tls_flows) do + if v == "none" then + o.default = "none" + o:value("none", translate("none")) + else + o:value("xtls-rprx-vision", translate("xtls-rprx-vision")) + end + end + o.rmempty = true + o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "xhttp", tls = true}) + o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "xhttp", reality = true}) + -- [[ uTLS ]]-- o = s:option(ListValue, "fingerprint", translate("Finger Print")) o.default = "" @@ -1051,19 +1064,36 @@ o:depends({type = "hysteria", insecure = true }) o.rmempty = true --- [[ Mux ]]-- -o = s:option(Flag, "mux", translate("Mux")) +-- [[ Mux.Cool ]] -- +o = s:option(Flag, "mux", translate("Mux"), translate("Enable Mux.Cool")) o.rmempty = false o.default = false -o:depends({type = "v2ray", v2ray_protocol = "vless"}) -o:depends({type = "v2ray", v2ray_protocol = "vmess"}) +o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "raw"}) +o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "ws"}) +o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "kcp"}) +o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "httpupgrade"}) +o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "splithttp"}) +o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "h2"}) +o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "quic"}) +o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "grpc"}) o:depends({type = "v2ray", v2ray_protocol = "trojan"}) o:depends({type = "v2ray", v2ray_protocol = "shadowsocks"}) o:depends({type = "v2ray", v2ray_protocol = "socks"}) o:depends({type = "v2ray", v2ray_protocol = "http"}) +-- [[ XUDP Mux ]] -- +o = s:option(Flag, "xmux", translate("Xudp Mux"), translate("Enable Xudp Mux")) +o.rmempty = false +o.default = false +o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "xhttp"}) + -- [[ TCP 最大并发连接数 ]]-- -o = s:option(ListValue, "concurrency", translate("concurrency")) +o = s:option(Value, "concurrency", translate("concurrency")) +o.description = translate( + "") o.rmempty = true o.default = "-1" o:value("-1", translate("disable")) @@ -1071,15 +1101,27 @@ o:value("8", translate("8")) o:depends("mux", true) -- [[ UDP 最大并发连接数 ]]-- -o = s:option(ListValue, "xudpConcurrency", translate("xudpConcurrency")) +o = s:option(Value, "xudpConcurrency", translate("xudpConcurrency")) +o.description = translate( + "") o.rmempty = true o.default = "16" o:value("-1", translate("disable")) o:value("16", translate("16")) o:depends("mux", true) +o:depends("xmux", true) -- [[ 对被代理的 UDP/443 流量处理方式 ]]-- o = s:option(ListValue, "xudpProxyUDP443", translate("xudpProxyUDP443")) +o.description = translate( + "") o.rmempty = true o.default = "reject" o:value("reject", translate("reject")) @@ -1087,11 +1129,16 @@ o:value("allow", translate("allow")) o:value("skip", translate("skip")) o:depends("mux", true) +-- [[ XHTTP TCP Fast Open ]]-- +o = s:option(Flag, "tcpfastopen", translate("TCP Fast Open"), translate("Enabling TCP Fast Open Requires Server Support.")) +o.rmempty = true +o.default = "0" +o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "xhttp"}) -- [[ MPTCP ]]-- -o = s:option(Flag, "mptcp", translate("MPTCP"), translate("Enabling MPTCP Requires Server Support.")) -o.rmempty = false -o.default = false +o = s:option(Flag, "mptcp", translate("MPTCP"), translate("Enable Multipath TCP, need to be enabled in both server and client configuration.")) +o.rmempty = true +o.default = "0" o:depends({type = "v2ray", v2ray_protocol = "vless"}) o:depends({type = "v2ray", v2ray_protocol = "vmess"}) o:depends({type = "v2ray", v2ray_protocol = "trojan"}) @@ -1166,7 +1213,7 @@ o:value("/etc/ssl/private/ca.pem") o.description = translate("Please confirm the current certificate path") o.default = "/etc/ssl/private/ca.pem" -o = s:option(Flag, "fast_open", translate("TCP Fast Open")) +o = s:option(Flag, "fast_open", translate("TCP Fast Open"), translate("Enabling TCP Fast Open Requires Server Support.")) o.rmempty = true o.default = "0" o:depends("type", "ssr") diff --git a/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm b/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm index 255beaa9c..b8f9db40f 100644 --- a/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm +++ b/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm @@ -374,12 +374,19 @@ function import_ssr_url(btn, urlname, sid) { if (ssm.tls == "tls") { document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls')[0].checked = true; document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls')[0].dispatchEvent(event); - document.getElementsByName('cbid.shadowsocksr.' + sid + '.xhttp_alpn')[0].value = ssm.alpn; + document.getElementsByName('cbid.shadowsocksr.' + sid + '.fingerprint')[0].value = ssm.fp; + if (ssm.net == "xhttp") { + document.getElementsByName('cbid.shadowsocksr.' + sid + '.xhttp_alpn')[0].value = ssm.alpn; + } document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls_host')[0].value = ssm.sni || ssm.host; } if (ssm.mux !== undefined) { - document.getElementsByName('cbid.shadowsocksr.' + sid + '.mux')[0].checked = true; - document.getElementsByName('cbid.shadowsocksr.' + sid + '.mux')[0].dispatchEvent(event); + document.getElementsByName('cbid.shadowsocksr.' + sid + '.mux')[0].checked = true; + document.getElementsByName('cbid.shadowsocksr.' + sid + '.mux')[0].dispatchEvent(event); + } + if (ssm.xmux !== undefined) { + document.getElementsByName('cbid.shadowsocksr.' + sid + '.xmux')[0].checked = true; + document.getElementsByName('cbid.shadowsocksr.' + sid + '.xmux')[0].dispatchEvent(event); } s.innerHTML = "<%:Import configuration information successfully.%>"; return false; diff --git a/luci-app-ssr-plus/po/zh_Hans/ssr-plus.po b/luci-app-ssr-plus/po/zh_Hans/ssr-plus.po index 3faa805e5..400c87503 100644 --- a/luci-app-ssr-plus/po/zh_Hans/ssr-plus.po +++ b/luci-app-ssr-plus/po/zh_Hans/ssr-plus.po @@ -91,18 +91,44 @@ msgstr "TLS 主机名" msgid "allowInsecure" msgstr "允许不安全连接" -msgid "Enabling MPTCP Requires Server Support." -msgstr "启用 MPTCP 需服务端支持。" +msgid "Enable Mux.Cool" +msgstr "启用 Mux.Cool" + +msgid "Enable Xudp Mux" +msgstr "启用 Xudp Mux" + +msgid "Enable Multipath TCP, need to be enabled in both server and client configuration." +msgstr "启用 Multipath TCP,需在服务端和客户端配置中同时启用。" msgid "concurrency" msgstr "TCP 最大并发连接数" +msgid "Default: disable. When entering a negative number, such as -1, The Mux module will not be used to carry TCP traffic." +msgstr "默认:禁用。填负数时,如 -1,不使用 Mux 模块承载 TCP 流量。" + +msgid "Min value is 1, Max value is 128. When omitted or set to 0, it equals 8." +msgstr "最小值 1,最大值 128。省略或者填 0 时都等于 8。" + msgid "xudpConcurrency" msgstr "UDP 最大并发连接数" +msgid "Default:16. When entering a negative number, such as -1, The Mux module will not be used to carry UDP traffic, Use original UDP transmission method of proxy protocol." +msgstr "默认值:16。填负数时,如 -1,不使用 Mux 模块承载 UDP 流量。将使用代理协议原本的 UDP 传输方式。" + +msgid "Min value is 1, Max value is 1024. When omitted or set to 0, Will same path as TCP traffic." +msgstr "最小值 1,最大值 1024。 省略或者填 0 时,将与 TCP 流量走同一条路,也就是传统的行为。" + msgid "xudpProxyUDP443" msgstr "对被代理的 UDP/443 流量处理方式" +msgid "Default reject rejects traffic." +msgstr "默认 reject 拒绝流量。" + +msgid "allow: Allows use Mux connection." +msgstr "allow:允许走 Mux 连接。" + +msgid "skip: Not use Mux module to carry UDP 443 traffic, Use original UDP transmission method of proxy protocol." +msgstr "skip:不使用 Mux 模块承载 UDP 443 流量,将使用代理协议原本的 UDP 传输方式。" msgid "custom_tcpcongestion" msgstr "连接服务器节点的 TCP 拥塞控制算法" @@ -307,6 +333,9 @@ msgstr "服务器" msgid "TCP Fast Open" msgstr "TCP 快速打开" +msgid "Enabling TCP Fast Open Requires Server Support." +msgstr "启用 TCP 快速打开需要服务端支持。" + msgid "Status" msgstr "状态" diff --git a/luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua b/luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua index 4071be9f3..375a4eac3 100755 --- a/luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua +++ b/luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua @@ -29,7 +29,7 @@ function vmess_vless() alterId = (server.v2ray_protocol == "vmess" or not server.v2ray_protocol) and tonumber(server.alter_id) or nil, security = (server.v2ray_protocol == "vmess" or not server.v2ray_protocol) and server.security or nil, encryption = (server.v2ray_protocol == "vless") and server.vless_encryption or nil, - flow = (((server.xtls == '1') or (server.tls == '1') or (server.reality == '1')) and server.tls_flow ~= "none") and server.tls_flow or nil + flow = (((server.xtls == '1') or (server.tls == '1') or (server.reality == '1')) and (((server.tls_flow ~= "none") and server.tls_flow) or ((server.xhttp_tls_flow ~= "none") and server.xhttp_tls_flow))) or nil } } } @@ -310,18 +310,19 @@ end } or nil, sockopt = { mark = 250, + tcpFastOpen = (server.tcpfastOpen == "1") and true or false, -- XHTTP Tcp Fast Open tcpMptcp = (server.mptcp == "1") and true or nil, -- MPTCP - tcpNoDelay = (server.mptcp == "1") and true or nil, -- MPTCP + Penetrate = (server.mptcp == "1") and true or nil, -- Penetrate MPTCP tcpcongestion = server.custom_tcpcongestion, -- 连接服务器节点的 TCP 拥塞控制算法 dialerProxy = (xray_fragment.fragment == "1" or xray_fragment.noise == "1") and "dialerproxy" or nil } } or nil, mux = (server.v2ray_protocol ~= "wireguard") and { -- mux - enabled = (server.mux == "1") and true or false, -- Mux - concurrency = tonumber(server.concurrency), -- TCP 最大并发连接数 - xudpConcurrency = tonumber(server.xudpConcurrency), -- UDP 最大并发连接数 - xudpProxyUDP443 = server.xudpProxyUDP443 -- 对被代理的 UDP/443 流量处理方式 + enabled = (server.mux == "1" or server.xmux == "1") and true or false, -- Mux + concurrency = (server.mux == "1" and ((server.concurrency ~= "0") and tonumber(server.concurrency) or 8)) or (server.xmux == "1" and -1) or nil, -- TCP 最大并发连接数 + xudpConcurrency = ((server.xudpConcurrency ~= "0") and tonumber(server.xudpConcurrency)) or nil, -- UDP 最大并发连接数 + xudpProxyUDP443 = (server.mux == "1") and server.xudpProxyUDP443 or nil -- 对被代理的 UDP/443 流量处理方式 } or nil } } @@ -349,8 +350,9 @@ if xray_fragment.fragment ~= "0" or (xray_fragment.noise ~= "0" and xray_noise.e streamSettings = { sockopt = { mark = 250, + tcpFastOpen = (server.tcpfastOpen == "1") and true or false, -- XHTTP Tcp Fast Open tcpMptcp = (server.mptcp == "1") and true or nil, -- MPTCP - tcpNoDelay = (server.mptcp == "1") and true or nil, -- MPTCP + Penetrate = (server.mptcp == "1") and true or nil, -- Penetrate MPTCP tcpcongestion = server.custom_tcpcongestion -- 连接服务器节点的 TCP 拥塞控制算法 } } diff --git a/patch-luci-app-ssr-plus.patch b/patch-luci-app-ssr-plus.patch index 187953a4b..ca65fbd96 100644 --- a/patch-luci-app-ssr-plus.patch +++ b/patch-luci-app-ssr-plus.patch @@ -338,7 +338,7 @@ index d0b77f1..259cb7f 100644 res(); }); diff --git a/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm b/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm -index d8dfbdd..255beaa 100644 +index 1ae02e4..b8f9db4 100644 --- a/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm +++ b/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm @@ -69,9 +69,9 @@ function export_ssr_url(btn, urlname, sid) { @@ -407,16 +407,16 @@ index d8dfbdd..255beaa 100644 return false; case "vmess": var sstr = b64DecodeUnicode(ssu[1]); -@@ -381,7 +381,7 @@ function import_ssr_url(btn, urlname, sid) { - document.getElementsByName('cbid.shadowsocksr.' + sid + '.mux')[0].checked = true; - document.getElementsByName('cbid.shadowsocksr.' + sid + '.mux')[0].dispatchEvent(event); +@@ -388,7 +388,7 @@ function import_ssr_url(btn, urlname, sid) { + document.getElementsByName('cbid.shadowsocksr.' + sid + '.xmux')[0].checked = true; + document.getElementsByName('cbid.shadowsocksr.' + sid + '.xmux')[0].dispatchEvent(event); } - s.innerHTML = "<%:Import configuration information successfully.%>"; + s.innerHTML = "<%:Import configuration information successfully.%>"; return false; case "vless": try { -@@ -499,10 +499,10 @@ function import_ssr_url(btn, urlname, sid) { +@@ -506,10 +506,10 @@ function import_ssr_url(btn, urlname, sid) { } break; } @@ -430,10 +430,10 @@ index d8dfbdd..255beaa 100644 } } diff --git a/luci-app-ssr-plus/po/zh_Hans/ssr-plus.po b/luci-app-ssr-plus/po/zh_Hans/ssr-plus.po -index 03541f4..3faa805 100644 +index 11440b6..400c875 100644 --- a/luci-app-ssr-plus/po/zh_Hans/ssr-plus.po +++ b/luci-app-ssr-plus/po/zh_Hans/ssr-plus.po -@@ -577,27 +577,6 @@ msgstr "使用 DNS2TCP 查询" +@@ -606,27 +606,6 @@ msgstr "使用 DNS2TCP 查询" msgid "Use DNS2SOCKS query and cache" msgstr "使用 DNS2SOCKS 查询并缓存"