luci-app-ssr-plus: fix Xray gPRC multi support

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen committed 2022-07-05 13:42:22 +08:00
1 parent 823927d246
commit e415353fc8
2 files changed
+5 -2

No files matched your search

@@ -462,13 +462,15 @@ o = s:option(Value, "serviceName", translate("gRPC Service Name"))
o:depends("transport", "grpc")
o.rmempty = true
if is_installed("sagernet-core") then
if is_finded("xray") or is_installed("sagernet-core") then
-- gPRC模式
o = s:option(ListValue, "grpc_mode", translate("gRPC Mode"))
o:depends("transport", "grpc")
o:value("gun", translate("Gun"))
o:value("multi", translate("Multi"))
o:value("raw", translate("Raw"))
if is_installed("sagernet-core") then
o:value("raw", translate("Raw"))
end
o.rmempty = true
end
@@ -224,6 +224,7 @@ local Xray = {
-- grpc
serviceName = server.serviceName or "",
mode = (server.grpc_mode ~= "gun") and server.grpc_mode or nil,
multiMode = (server.grpc_mode == "multi") and true or false,
idle_timeout = tonumber(server.idle_timeout) or nil,
health_check_timeout = tonumber(server.health_check_timeout) or nil,
permit_without_stream = (server.permit_without_stream == "1") and true or nil,