From 0ee2aead11c9da95b42a8d2ddbf84c3c4ed96c6b Mon Sep 17 00:00:00 2001 From: qianxu2001 Date: Mon, 28 Nov 2022 14:55:46 +0800 Subject: [PATCH] luci-app-ssr-plus: support Hysteria Fast Open Fast Open can shave off one RTT for every connection at the cost of the correct semantics of SOCKS5/HTTP/TUN protocols. When enabled, the client will always accept a connection immediately without confirming with the server that its destination is reachable. If the server then fails to connect or rejects the connection, the client will just close it without sending any data. --- .../luasrc/model/cbi/shadowsocksr/client-config.lua | 1 + luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua | 3 ++- 2 files changed, 3 insertions(+), 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 c04987009..7bca388d9 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 @@ -772,6 +772,7 @@ o.default = "0" o:depends("type", "ssr") o:depends("type", "ss") o:depends("type", "trojan") +o:depends("type", "hysteria") if is_installed("sagernet-core") then o = s:option(ListValue, "packet_encoding", translate("Packet Encoding")) 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 b18d2492e..17765a55b 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 @@ -311,7 +311,8 @@ local hysteria = { ca = (server.certificate) and server.certpath or nil, recv_window_conn = tonumber(server.recv_window_conn), recv_window = tonumber(server.recv_window), - disable_mtu_discovery = (server.disable_mtu_discovery == "1") and true or false + disable_mtu_discovery = (server.disable_mtu_discovery == "1") and true or false, + fast_open = (server.fast_open == "1") and true or false } local config = {} function config:new(o)