Browse Source

luci-app-ssr-plus: support Xray TLS flow

Signed-off-by: Tianling Shen <[email protected]>
Tianling Shen 3 years ago
parent
commit
9be84f1184

+ 14 - 0
luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua

@@ -124,6 +124,12 @@ local flows = {
 	"xtls-rprx-splice-udp443"
 }
 
+local tls_flows = {
+	-- tls
+	"xtls-rprx-vision",
+	"xtls-rprx-vision-udp443"
+}
+
 m = Map("shadowsocksr", translate("Edit ShadowSocksR Server"))
 m.redirect = luci.dispatcher.build_url("admin/services/shadowsocksr/servers")
 if m.uci:get("shadowsocksr", sid) ~= "servers" then
@@ -648,6 +654,14 @@ o.default = "xtls-rprx-splice"
 o:depends("xtls", true)
 
 -- [[ TLS部分 ]] --
+-- Flow
+o = s:option(Value, "tls_flow", translate("Flow"))
+for _, v in ipairs(tls_flows) do
+	o:value(v, translate(v))
+end
+o.rmempty = true
+o:depends({type = "v2ray", v2ray_protocol = "vless", "tls" = true})
+
 o = s:option(Flag, "tls_sessionTicket", translate("Session Ticket"))
 o:depends({type = "trojan", tls = true})
 o.default = "0"

+ 2 - 2
luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua

@@ -22,7 +22,7 @@ function vmess_vless()
 						id = server.vmess_id,
 						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') and (server.vless_flow and server.vless_flow or "xtls-rprx-splice") or nil
+						flow = (server.xtls == '1') and (server.vless_flow or "xtls-rprx-splice") or (server.tls == '1') and server.tls_flow or nil
 					}
 				}
 			}
@@ -48,7 +48,7 @@ function trojan_shadowsocks()
 				method = ((server.v2ray_protocol == "shadowsocks") and server.encrypt_method_ss) or ((server.v2ray_protocol == "shadowsocksr") and server.encrypt_method) or nil,
 				uot = (server.v2ray_protocol == "shadowsocks") and (server.uot == '1') or nil,
 				ivCheck = (server.v2ray_protocol == "shadowsocks") and (server.ivCheck == '1') or nil,
-				flow = (server.v2ray_protocol == "trojan") and (server.xtls == '1') and (server.vless_flow and server.vless_flow or "xtls-rprx-splice") or nil
+				flow = (server.v2ray_protocol == "trojan") and (server.xtls == '1') and (server.vless_flow or "xtls-rprx-splice") or nil
 			}
 		}
 	}