Skip to content

Commit

Permalink
luci-app-ssr-plus: Fix flow control and TCP/RAW transport protocol co…
Browse files Browse the repository at this point in the history
…nfigurations issues.

*** 在导入启用TLS或reality但无流量控制参数的节点时,默认仍导入flow,从而导致节点无法正常代理。同时tcp或raw传输协议配置应调整为无http和有http情况下的对应配置。
  • Loading branch information
zxlhhyccc committed Dec 13, 2024
1 parent 4af6d72 commit 27f989d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,12 @@ if is_finded("xray") then
-- [[ XTLS ]]--
o = s:option(ListValue, "tls_flow", translate("Flow"))
for _, v in ipairs(tls_flows) do
o:value(v, translate(v))
if v == "none" then
o.default = "none"
o:value("none", translate("none"))
else
o:value(v, translate(v))
end
end
o.rmempty = true
o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "tcp", tls = true})
Expand Down
18 changes: 9 additions & 9 deletions luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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 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
}
}
}
Expand Down Expand Up @@ -220,26 +220,26 @@ end
fingerprint = server.fingerprint,
serverName = server.tls_host
} or nil,
tcpSettings = (server.transport == "tcp" and server.tcp_guise == "http") and {
tcpSettings = (server.transport == "tcp") and {
-- tcp
header = {
type = server.tcp_guise,
request = {
type = server.tcp_guise or "none",
request = (server.tcp_guise == "http") and {
-- request
path = {server.http_path} or {"/"},
headers = {Host = {server.http_host} or {}}
}
} or nil
}
} or nil,
rawSettings = (server.transport == "raw" and server.raw_guise == "http") and {
rawSettings = (server.transport == "raw") and {
-- raw
header = {
type = server.raw_guise,
request = {
type = server.raw_guise or "none",
request = (server.raw_guise == "http") and {
-- request
path = {server.http_path} or {"/"},
headers = {Host = {server.http_host} or {}}
}
} or nil
}
} or nil,
kcpSettings = (server.transport == "kcp") and {
Expand Down

0 comments on commit 27f989d

Please sign in to comment.