diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/hysteria2.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/hysteria2.lua index e7babfe8..314010f1 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/hysteria2.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/hysteria2.lua @@ -38,13 +38,19 @@ o.placeholder = "30" o.default = "30" o.rewrite_option = o.option -o = s:option(Value, _n("obfs"), translate("Obfs Password")) -o.rewrite_option = o.option - o = s:option(Value, _n("auth_password"), translate("Auth Password")) o.password = true o.rewrite_option = o.option +o = s:option(ListValue, _n("obfs_type"), translate("Obfs Type")) +o:value("", translate("Disable")) +o:value("salamander") +o.rewrite_option = o.option + +o = s:option(Value, _n("obfs_password"), translate("Obfs Password")) +o.rewrite_option = o.option +o:depends({ [_n("obfs_type")] = "salamander" }) + o = s:option(Flag, _n("fast_open"), translate("Fast Open")) o.default = "0" 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 7e772dce..1ee689e7 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 @@ -339,11 +339,9 @@ o.placeholder = "30" o.default = "30" o:depends({ [_n("protocol")] = "hysteria2" }) -o = s:option(Value, _n("hysteria2_up_mbps"), translate("Max upload Mbps")) -o:depends({ [_n("protocol")] = "hysteria2" }) - -o = s:option(Value, _n("hysteria2_down_mbps"), translate("Max download Mbps")) -o:depends({ [_n("protocol")] = "hysteria2" }) +o = s:option(Value, _n("hysteria2_auth_password"), translate("Auth Password")) +o.password = true +o:depends({ [_n("protocol")] = "hysteria2"}) o = s:option(ListValue, _n("hysteria2_obfs_type"), translate("Obfs Type")) o:value("", translate("Disable")) @@ -353,9 +351,11 @@ o:depends({ [_n("protocol")] = "hysteria2" }) o = s:option(Value, _n("hysteria2_obfs_password"), translate("Obfs Password")) o:depends({ [_n("hysteria2_obfs_type")] = "salamander" }) -o = s:option(Value, _n("hysteria2_auth_password"), translate("Auth Password")) -o.password = true -o:depends({ [_n("protocol")] = "hysteria2"}) +o = s:option(Value, _n("hysteria2_up_mbps"), translate("Max upload Mbps")) +o:depends({ [_n("protocol")] = "hysteria2" }) + +o = s:option(Value, _n("hysteria2_down_mbps"), translate("Max download Mbps")) +o:depends({ [_n("protocol")] = "hysteria2" }) o = s:option(Value, _n("hysteria2_idle_timeout"), translate("Idle Timeout"), translate("Example:") .. "30s (4s~120s)") o:depends({ [_n("protocol")] = "hysteria2"}) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua index 1c4a5e40..712b68ab 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua @@ -353,17 +353,15 @@ if singbox_tags:find("with_quic") then o.description = translate("Format as 1000:2000 or 1000-2000 Multiple groups are separated by commas (,).") o:depends({ [_n("protocol")] = "hysteria2" }) - o = s:option(Value, _n("hysteria2_hop_interval"), translate("Hop Interval(Second)"), translate("Supports a fixed value or a random range (e.g., 30, 5-30), minimum 5.")) + o = s:option(Value, _n("hysteria2_hop_interval"), translate("Hop Interval(second)"), translate("Supports a fixed value or a random range (e.g., 30, 5-30), minimum 5.")) o.datatype = "or(uinteger,portrange)" o.placeholder = "30" o.default = "30" o:depends({ [_n("protocol")] = "hysteria2" }) - o = s:option(Value, _n("hysteria2_up_mbps"), translate("Max upload Mbps")) - o:depends({ [_n("protocol")] = "hysteria2" }) - - o = s:option(Value, _n("hysteria2_down_mbps"), translate("Max download Mbps")) - o:depends({ [_n("protocol")] = "hysteria2" }) + o = s:option(Value, _n("hysteria2_auth_password"), translate("Auth Password")) + o.password = true + o:depends({ [_n("protocol")] = "hysteria2"}) o = s:option(ListValue, _n("hysteria2_obfs_type"), translate("Obfs Type")) o:value("", translate("Disable")) @@ -373,8 +371,20 @@ if singbox_tags:find("with_quic") then o = s:option(Value, _n("hysteria2_obfs_password"), translate("Obfs Password")) o:depends({ [_n("hysteria2_obfs_type")] = "salamander" }) - o = s:option(Value, _n("hysteria2_auth_password"), translate("Auth Password")) - o.password = true + o = s:option(Value, _n("hysteria2_up_mbps"), translate("Max upload Mbps")) + o:depends({ [_n("protocol")] = "hysteria2" }) + + o = s:option(Value, _n("hysteria2_down_mbps"), translate("Max download Mbps")) + o:depends({ [_n("protocol")] = "hysteria2" }) + + o = s:option(Value, _n("hysteria2_idle_timeout"), translate("Idle Timeout"), translate("Example:") .. "30s (4s~120s)") + o:depends({ [_n("protocol")] = "hysteria2"}) + + o = s:option(Value, _n("hysteria2_keep_alive_period"), translate("QUIC KeepAlive interval"), translate("Example:") .. "10s (2s~60s)") + o:depends({ [_n("protocol")] = "hysteria2"}) + + o = s:option(Flag, _n("hysteria2_disable_mtu_discovery"), translate("Disable MTU detection")) + o.default = "0" o:depends({ [_n("protocol")] = "hysteria2"}) end diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/hysteria2.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/hysteria2.lua index c6903c17..5fbf3707 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/hysteria2.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/hysteria2.lua @@ -26,15 +26,21 @@ o = s:option(Value, _n("port"), translate("Listen Port")) o.datatype = "port" o:depends({ [_n("custom")] = false }) -o = s:option(Value, _n("obfs"), translate("Obfs Password")) -o.rewrite_option = o.option -o:depends({ [_n("custom")] = false }) - o = s:option(Value, _n("auth_password"), translate("Auth Password")) o.password = true o.rewrite_option = o.option o:depends({ [_n("custom")] = false }) +o = s:option(ListValue, _n("obfs_type"), translate("Obfs Type")) +o:value("", translate("Disable")) +o:value("salamander") +o.rewrite_option = o.option +o:depends({ [_n("custom")] = false }) + +o = s:option(Value, _n("obfs_password"), translate("Obfs Password")) +o.rewrite_option = o.option +o:depends({ [_n("obfs_type")] = "salamander" }) + o = s:option(Flag, _n("udp"), translate("UDP")) o.default = "1" o.rewrite_option = o.option diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/ray.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/ray.lua index e7daa4e5..ec45fac0 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/ray.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/ray.lua @@ -128,6 +128,14 @@ o = s:option(Value, _n("hysteria2_auth_password"), translate("Auth Password")) o.password = true o:depends({ [_n("protocol")] = "hysteria2"}) +o = s:option(ListValue, _n("hysteria2_obfs_type"), translate("Obfs Type")) +o:value("", translate("Disable")) +o:value("salamander") +o:depends({ [_n("protocol")] = "hysteria2" }) + +o = s:option(Value, _n("hysteria2_obfs_password"), translate("Obfs Password")) +o:depends({ [_n("hysteria2_obfs_type")] = "salamander" }) + o = s:option(Flag, _n("hysteria2_ignore_client_bandwidth"), translate("Client BBR Flow Control")) o.default = 0 o:depends({ [_n("protocol")] = "hysteria2" }) @@ -138,14 +146,6 @@ o:depends({ [_n("protocol")] = "hysteria2", [_n("hysteria2_ignore_client_bandwid o = s:option(Value, _n("hysteria2_down_mbps"), translate("Max download Mbps")) o:depends({ [_n("protocol")] = "hysteria2", [_n("hysteria2_ignore_client_bandwidth")] = false }) -o = s:option(ListValue, _n("hysteria2_obfs_type"), translate("Obfs Type")) -o:value("", translate("Disable")) -o:value("salamander") -o:depends({ [_n("protocol")] = "hysteria2" }) - -o = s:option(Value, _n("hysteria2_obfs_password"), translate("Obfs Password")) -o:depends({ [_n("hysteria2_obfs_type")] = "salamander" }) - ---- [[ TLS ]] o = s:option(Flag, _n("tls"), translate("TLS")) o.default = 0 diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/sing-box.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/sing-box.lua index 7e815a24..d018f625 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/sing-box.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/sing-box.lua @@ -158,6 +158,14 @@ if singbox_tags:find("with_quic") then o.password = true o:depends({ [_n("protocol")] = "hysteria2"}) + o = s:option(ListValue, _n("hysteria2_obfs_type"), translate("Obfs Type")) + o:value("", translate("Disable")) + o:value("salamander") + o:depends({ [_n("protocol")] = "hysteria2" }) + + o = s:option(Value, _n("hysteria2_obfs_password"), translate("Obfs Password")) + o:depends({ [_n("hysteria2_obfs_type")] = "salamander" }) + o = s:option(Flag, _n("hysteria2_ignore_client_bandwidth"), translate("Client BBR Flow Control"), translate("Commands the client to use the BBR flow control algorithm")) o.default = 0 o:depends({ [_n("protocol")] = "hysteria2" }) @@ -167,14 +175,6 @@ if singbox_tags:find("with_quic") then o = s:option(Value, _n("hysteria2_down_mbps"), translate("Max download Mbps")) o:depends({ [_n("protocol")] = "hysteria2", [_n("hysteria2_ignore_client_bandwidth")] = false }) - - o = s:option(ListValue, _n("hysteria2_obfs_type"), translate("Obfs Type")) - o:value("", translate("Disable")) - o:value("salamander") - o:depends({ [_n("protocol")] = "hysteria2" }) - - o = s:option(Value, _n("hysteria2_obfs_password"), translate("Obfs Password")) - o:depends({ [_n("hysteria2_obfs_type")] = "salamander" }) end o = s:option(ListValue, _n("d_protocol"), translate("Destination protocol")) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua index 6e85945b..2d5a9bba 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/server/user.lua @@ -31,7 +31,11 @@ local type_table = {} for filename in fs.dir(types_dir) do table.insert(type_table, filename) end -table.sort(type_table) +table.sort(type_table, function(a, b) + if a == "socks.lua" then return true end + if b == "socks.lua" then return false end + return a < b +end) for index, value in ipairs(type_table) do local p_func = loadfile(types_dir .. value) diff --git a/luci-app-passwall/luasrc/passwall/util_hysteria2.lua b/luci-app-passwall/luasrc/passwall/util_hysteria2.lua index 908aec10..957908aa 100644 --- a/luci-app-passwall/luasrc/passwall/util_hysteria2.lua +++ b/luci-app-passwall/luasrc/passwall/util_hysteria2.lua @@ -10,10 +10,10 @@ function gen_config_server(node) cert = node.tls_certificateFile, key = node.tls_keyFile, }, - obfs = (node.hysteria2_obfs) and { + obfs = (node.hysteria2_obfs_type and node.hysteria2_obfs_password) and { type = "salamander", salamander = { - password = node.hysteria2_obfs + password = node.hysteria2_obfs_password } } or nil, auth = { @@ -86,10 +86,10 @@ function gen_config(var) return udp end)() or nil }, - obfs = (node.hysteria2_obfs) and { + obfs = (node.hysteria2_obfs_type and node.hysteria2_obfs_password) and { type = "salamander", salamander = { - password = node.hysteria2_obfs + password = node.hysteria2_obfs_password } } or nil, auth = node.hysteria2_auth_password, diff --git a/luci-app-passwall/luasrc/passwall/util_sing-box.lua b/luci-app-passwall/luasrc/passwall/util_sing-box.lua index 06c3ec07..ba8f8f48 100644 --- a/luci-app-passwall/luasrc/passwall/util_sing-box.lua +++ b/luci-app-passwall/luasrc/passwall/util_sing-box.lua @@ -485,9 +485,9 @@ function gen_outbound(flag, node, tag, proxy_table) obfs = node.hysteria_obfs, auth = (node.hysteria_auth_type == "base64") and node.hysteria_auth_password or nil, auth_str = (node.hysteria_auth_type == "string") and node.hysteria_auth_password or nil, - recv_window_conn = tonumber(node.hysteria_recv_window_conn), - recv_window = tonumber(node.hysteria_recv_window), - disable_mtu_discovery = (node.hysteria_disable_mtu_discovery == "1") and true or false, + recv_window_conn = tonumber(node.hysteria_recv_window_conn), --1.14 将变更为 stream_receive_window + recv_window = tonumber(node.hysteria_recv_window), --1.14 将变更为 connection_receive_window + disable_mtu_discovery = (node.hysteria_disable_mtu_discovery == "1") and true or false, --1.14 将变更为 disable_path_mtu_discovery tls = tls } end @@ -560,6 +560,17 @@ function gen_outbound(flag, node, tag, proxy_table) password = node.hysteria2_obfs_password } or nil, password = node.hysteria2_auth_password or nil, + idle_timeout = (function(t) + if not version_ge_1_14_0 then return nil end + t = tonumber(tostring(t or "30"):match("^%d+")) + return (t and t >= 4 and t <= 120) and t or 30 + end)(node.hysteria2_idle_timeout), + keep_alive_period = (function(t) + if not version_ge_1_14_0 then return nil end + t = tonumber(tostring(t or "0"):match("^%d+")) + return (t and t >= 2 and t <= 60) and t or nil + end)(node.hysteria2_keep_alive_period), + disable_path_mtu_discovery = version_ge_1_14_0 and (tonumber(node.hysteria2_disable_mtu_discovery) == 1) or nil, tls = tls } end @@ -846,10 +857,10 @@ function gen_config_server(node) auth_str = (node.hysteria_auth_type == "string") and node.hysteria_auth_password or nil, } }, - recv_window_conn = node.hysteria_recv_window_conn and tonumber(node.hysteria_recv_window_conn) or nil, - recv_window_client = node.hysteria_recv_window_client and tonumber(node.hysteria_recv_window_client) or nil, - max_conn_client = node.hysteria_max_conn_client and tonumber(node.hysteria_max_conn_client) or nil, - disable_mtu_discovery = (node.hysteria_disable_mtu_discovery == "1") and true or false, + recv_window_conn = node.hysteria_recv_window_conn and tonumber(node.hysteria_recv_window_conn) or nil, --1.14 to stream_receive_window + recv_window_client = node.hysteria_recv_window_client and tonumber(node.hysteria_recv_window_client) or nil, --1.14 to connection_receive_window + max_conn_client = node.hysteria_max_conn_client and tonumber(node.hysteria_max_conn_client) or nil, --1.14 to max_concurrent_streams + disable_mtu_discovery = (node.hysteria_disable_mtu_discovery == "1") and true or false, --1.14 to disable_path_mtu_discover tls = tls } end diff --git a/luci-app-passwall/luasrc/view/passwall/node_config/link_share_man.htm b/luci-app-passwall/luasrc/view/passwall/node_config/link_share_man.htm index 844bf3d9..ad283988 100644 --- a/luci-app-passwall/luasrc/view/passwall/node_config/link_share_man.htm +++ b/luci-app-passwall/luasrc/view/passwall/node_config/link_share_man.htm @@ -602,10 +602,10 @@ local current_node = map:get(section) if (v_type === "Hysteria2") { v_password = opt.get("hysteria2_auth_password"); - var dom_obfs = opt.get("hysteria2_obfs"); + var dom_obfs = opt.get("hysteria2_obfs_password"); if (dom_obfs && dom_obfs.value != "") { params += "&obfs=" + "salamander"; - params += opt.query("obfs-password", "hysteria2_obfs"); + params += opt.query("obfs-password", "hysteria2_obfs_password"); } params += opt.query("mport", "hysteria2_hop"); } else { @@ -1620,7 +1620,8 @@ local current_node = map:get(section) dom_prefix = "hysteria2_" opt.set(dom_prefix + 'auth_password', decodeURIComponent(password)); if (queryParam["obfs-password"] || queryParam["obfs_password"]) { - opt.set(dom_prefix + 'obfs', queryParam["obfs-password"] || queryParam["obfs_password"]); + opt.set(dom_prefix + 'obfs_type', "salamander"); + opt.set(dom_prefix + 'obfs_password', queryParam["obfs-password"] || queryParam["obfs_password"]); } opt.set(dom_prefix + 'hop', queryParam.mport || ""); } diff --git a/luci-app-passwall/root/usr/share/passwall/subscribe.lua b/luci-app-passwall/root/usr/share/passwall/subscribe.lua index 7e1ec3c0..ee3d8eed 100755 --- a/luci-app-passwall/root/usr/share/passwall/subscribe.lua +++ b/luci-app-passwall/root/usr/share/passwall/subscribe.lua @@ -1415,22 +1415,19 @@ local function processData(szType, content, add_mode, group, sub_cfg) local insecure = params.allowinsecure or params.insecure result.tls_allowInsecure = (insecure == "1" or insecure == "0") and insecure or (sub_allowinsecure and "1" or "0") result.hysteria2_hop = params.mport + if params["obfs-password"] or params["obfs_password"] then + result.hysteria2_obfs_type = "salamander" + result.hysteria2_obfs_password = params["obfs-password"] or params["obfs_password"] + end if (sub_hysteria2_type == "sing-box" and has_singbox) or (sub_hysteria2_type == "xray" and has_xray) then local is_singbox = sub_hysteria2_type == "sing-box" and has_singbox result.type = is_singbox and 'sing-box' or 'Xray' result.protocol = "hysteria2" - if params["obfs-password"] or params["obfs_password"] then - result.hysteria2_obfs_type = "salamander" - result.hysteria2_obfs_password = params["obfs-password"] or params["obfs_password"] - end result.use_finalmask = (params.fm and params.fm ~= "") and "1" or nil result.finalmask = (params.fm and params.fm ~= "") and api.base64Encode(params.fm) or nil elseif has_hysteria2 then result.type = "Hysteria2" - if params["obfs-password"] or params["obfs_password"] then - result.hysteria2_obfs = params["obfs-password"] or params["obfs_password"] - end else log("跳过 Hysteria2 节点,因未适配到 Hysteria2 核心程序,或未正确设置节点使用类型。") return nil diff --git a/luci-app-ssr-plus/Makefile b/luci-app-ssr-plus/Makefile index 3ed3372a..e40b16ea 100644 --- a/luci-app-ssr-plus/Makefile +++ b/luci-app-ssr-plus/Makefile @@ -4,7 +4,7 @@ LUCI_TITLE:=luci-app-ssr-plus LUCI_PKGARCH:=all PKG_NAME:=luci-app-ssr-plus PKG_VERSION:=193 -PKG_RELEASE:=22 +PKG_RELEASE:=23 PKG_CONFIG_DEPENDS:= \ CONFIG_PACKAGE_$(PKG_NAME)_Iptables_Transparent_Proxy \ @@ -112,11 +112,11 @@ endchoice config PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS_NG bool "Include ChinaDNS-NG" - default n + default y if aarch64||arm||i386||x86_64 config PACKAGE_$(PKG_NAME)_INCLUDE_MosDNS bool "Include MosDNS" - default y if aarch64||arm||i386||x86_64 + default n config PACKAGE_$(PKG_NAME)_INCLUDE_Http_Proxy bool "Include HTTP(S) Proxy Server"