From 86e2e409ab0236fa11adf88e9815e9a74f3f5f4e Mon Sep 17 00:00:00 2001 From: AmberisMyShiba <20527882+AmberisMyShiba@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:27:58 +0800 Subject: [PATCH] update for hysteria client configrations --- .../model/cbi/shadowsocksr/client-config.lua | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 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 704741d91..eb716f062 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 @@ -323,33 +323,39 @@ o = s:option(Value, "hy2_auth", translate("Users Authentication")) o:depends("type", "hysteria") o.rmempty = false -o = s:option(ListValue, "transport_protocol", translate("Protocol")) -o:depends("type", "hysteria") -o:value("udp", translate("udp")) -o.default = "udp" -o.rmempty = true - -o = s:option(Flag, "port_hopping", translate("Enable Port Hopping")) +o = s:option(Flag, "flag_port_hopping", translate("Enable Port Hopping")) o:depends("type", "hysteria") o.rmempty = true o.default = "0" -o = s:option(Value, "hopinterval", translate("Port Hopping Interval(Unit:Second)")) -o:depends({type = "hysteria", port_hopping = true}) +o = s:option(Value, "port_range", translate("Port Range")) +o:depends({type = "hysteria", flag_port_hopping = true}) +o.datatype = "portrange" +o.rmempty = true + +o = s:option(Flag, "flag_transport", translate("Enable Transport Protocol Settings")) +o:depends("type", "hysteria") +o.rmempty = true +o.default = "0" + +o = s:option(ListValue, "transport_protocol", translate("Transport Protocol")) +o:depends({type = "hysteria", flag_transport = true}) +o:value("udp", translate("UDP")) +o.default = "udp" +o.rmempty = true + +o = s:option(Value, "hopinterval", translate("Hop Interval(Unit:Second)")) +o:depends({type = "hysteria", flag_transport = true, flag_port_hopping = true}) o.datatype = "uinteger" o.rmempty = true o.default = "30" -o = s:option(Value, "port_range", translate("Port Range")) -o:depends({type = "hysteria", port_hopping = true}) -o.rmempty = true - -o = s:option(Flag, "lazy_mode", translate("Enable Lazy Mode")) +o = s:option(Flag, "flag_obfs", translate("Enable Obfuscation")) o:depends("type", "hysteria") o.rmempty = true o.default = "0" -o = s:option(Flag, "flag_obfs", translate("Enable Obfuscation")) +o = s:option(Flag, "lazy_mode", translate("Lazy Mode")) o:depends("type", "hysteria") o.rmempty = true o.default = "0" @@ -369,6 +375,11 @@ o:depends("type", "hysteria") o.rmempty = true o.default = "0" +o = s:option(Flag, "disablepathmtudiscovery", translate("Disable QUIC path MTU discovery.")) +o:depends({type = "hysteria",flag_quicparam = "1"}) +o.rmempty = true +o.default = false + --[[Hysteria2 QUIC parameters setting]] o = s:option(Value, "initstreamreceivewindow", translate("QUIC initStreamReceiveWindow")) o:depends({type = "hysteria", flag_quicparam = "1"}) @@ -406,11 +417,6 @@ o.rmempty = true o.datatype = "uinteger" o.default = "10" -o = s:option(Flag, "disablepathmtudiscovery", translate("Disable Path MTU discovery")) -o:depends({type = "hysteria", flag_quicparam = "1"}) -o.rmempty = true -o.default = false - --[[ Shadow-TLS Options ]] o = s:option(ListValue, "shadowtls_protocol", translate("shadowTLS protocol Version")) @@ -902,9 +908,7 @@ o:depends("reality", true) o.rmempty = true o = s:option(DynamicList, "tls_alpn", translate("TLS ALPN")) -o:depends("tls", true) -o:depends("type", "tuic") -o:depends("type", "hysteria") +o:depends({type = "tuic", tls = true}) o.rmempty = true -- [[ allowInsecure ]]--