From 7a9d2c8f7633bc373e24d882b415b85dca0421c7 Mon Sep 17 00:00:00 2001 From: TeF Date: Mon, 21 Aug 2023 09:55:37 +0800 Subject: [PATCH 1/4] support hysteria port hopping in server settings page --- .../model/cbi/shadowsocksr/client-config.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 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 e39088b120f..947b0dc0c0d 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 @@ -205,13 +205,13 @@ o:depends("type", "socks5") o = s:option(Value, "server_port", translate("Server Port")) o.datatype = "port" -o.rmempty = false +o.rmempty = ({port_hopping=0 and false or true}) o:depends("type", "ssr") o:depends("type", "ss") o:depends("type", "v2ray") o:depends("type", "trojan") o:depends("type", "naiveproxy") -o:depends("type", "hysteria") +o:depends({type="hysteria",port_hopping=0}) o:depends("type", "tuic") o:depends("type", "socks5") @@ -308,6 +308,16 @@ o = s:option(Value, "obfs_param", translate("Obfs param (optional)")) o:depends("type", "ssr") -- [[ Hysteria ]]-- +o = s:option(Flag, "port_hopping", translate("Port Hopping")) +o:depends("type", "hysteria") +o.rmempty = true +o.default = "0" + +o = s:option(Value, "port_range", translate("Port range")) +o:depends({type = "hysteria", port_hopping = "1"}) +o.datatype = "portrange" +o.rmempty = true + o = s:option(ListValue, "hysteria_protocol", translate("Protocol")) o:depends("type", "hysteria") o:value("udp", translate("udp")) From 853e1a9638652c1918af0f02bf2b3654e3e24691 Mon Sep 17 00:00:00 2001 From: TeF Date: Mon, 21 Aug 2023 16:04:45 +0800 Subject: [PATCH 2/4] support hysteria port hopping feature --- luci-app-ssr-plus/po/zh-cn/ssr-plus.po | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/luci-app-ssr-plus/po/zh-cn/ssr-plus.po b/luci-app-ssr-plus/po/zh-cn/ssr-plus.po index aaa22781e0a..b3f34a8871a 100644 --- a/luci-app-ssr-plus/po/zh-cn/ssr-plus.po +++ b/luci-app-ssr-plus/po/zh-cn/ssr-plus.po @@ -106,6 +106,12 @@ msgstr "混淆参数(可选)" msgid "Authentication type" msgstr "验证类型" +msgid "Port Hopping" +msgstr "端口跃迁" + +msgid "Port Range" +msgstr "端口范围" + msgid "Authentication payload" msgstr "验证载荷" From 8494eb65a8c6dee0201dcec6e3aeec30871a07d0 Mon Sep 17 00:00:00 2001 From: TeF Date: Mon, 21 Aug 2023 16:07:11 +0800 Subject: [PATCH 3/4] fix minors --- .../luasrc/model/cbi/shadowsocksr/client-config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 947b0dc0c0d..82207e24bce 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 @@ -313,7 +313,7 @@ o:depends("type", "hysteria") o.rmempty = true o.default = "0" -o = s:option(Value, "port_range", translate("Port range")) +o = s:option(Value, "port_range", translate("Port Range")) o:depends({type = "hysteria", port_hopping = "1"}) o.datatype = "portrange" o.rmempty = true From 985dc67c787b8cedfabad053c83c6c4e681492be Mon Sep 17 00:00:00 2001 From: TeF Date: Mon, 21 Aug 2023 16:25:34 +0800 Subject: [PATCH 4/4] fix minors --- .../luasrc/model/cbi/shadowsocksr/client-config.lua | 2 +- luci-app-ssr-plus/po/zh-cn/ssr-plus.po | 6 +++--- 2 files changed, 4 insertions(+), 4 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 82207e24bce..f5b84571781 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 @@ -308,7 +308,7 @@ o = s:option(Value, "obfs_param", translate("Obfs param (optional)")) o:depends("type", "ssr") -- [[ Hysteria ]]-- -o = s:option(Flag, "port_hopping", translate("Port Hopping")) +o = s:option(Flag, "port_hopping", translate("Enable Port Hopping")) o:depends("type", "hysteria") o.rmempty = true o.default = "0" diff --git a/luci-app-ssr-plus/po/zh-cn/ssr-plus.po b/luci-app-ssr-plus/po/zh-cn/ssr-plus.po index b3f34a8871a..2546b9f3699 100644 --- a/luci-app-ssr-plus/po/zh-cn/ssr-plus.po +++ b/luci-app-ssr-plus/po/zh-cn/ssr-plus.po @@ -106,11 +106,11 @@ msgstr "混淆参数(可选)" msgid "Authentication type" msgstr "验证类型" -msgid "Port Hopping" -msgstr "端口跃迁" +msgid "Enable Port Hopping" +msgstr "启用端口跃迁" msgid "Port Range" -msgstr "端口范围" +msgstr "端口范围值" msgid "Authentication payload" msgstr "验证载荷"