diff --git a/luci-app-passwall2/luasrc/model/cbi/passwall2/server/type/ray.lua b/luci-app-passwall2/luasrc/model/cbi/passwall2/server/type/ray.lua index cabd948e5..642154734 100644 --- a/luci-app-passwall2/luasrc/model/cbi/passwall2/server/type/ray.lua +++ b/luci-app-passwall2/luasrc/model/cbi/passwall2/server/type/ray.lua @@ -142,7 +142,7 @@ o:depends({ [option_name("tls")] = true }) o = s:option(Value, option_name("reality_private_key"), translate("Private Key")) o:depends({ [option_name("reality")] = true }) -o = s:option(Value, option_name("reality_shortId"), translate("Short Id")) +o = s:option(DynamicList, option_name("reality_shortId"), translate("Short Id")) o:depends({ [option_name("reality")] = true }) o = s:option(Value, option_name("reality_dest"), translate("Dest")) @@ -300,8 +300,7 @@ o = s:option(Value, option_name("grpc_serviceName"), "ServiceName") o:depends({ [option_name("transport")] = "grpc" }) o = s:option(Flag, option_name("acceptProxyProtocol"), translate("acceptProxyProtocol"), translate("Whether to receive PROXY protocol, when this node want to be fallback or forwarded by proxy, it must be enable, otherwise it cannot be used.")) -o:depends({ [option_name("transport")] = "tcp" }) -o:depends({ [option_name("transport")] = "ws" }) +o.default = "0" -- [[ Fallback部分 ]]-- o = s:option(Flag, option_name("fallback"), translate("Fallback")) diff --git a/luci-app-passwall2/luasrc/passwall2/util_xray.lua b/luci-app-passwall2/luasrc/passwall2/util_xray.lua index 8004731c3..57935b9ae 100644 --- a/luci-app-passwall2/luasrc/passwall2/util_xray.lua +++ b/luci-app-passwall2/luasrc/passwall2/util_xray.lua @@ -430,7 +430,6 @@ function gen_config_server(node) } } or nil, tcpSettings = (node.transport == "tcp") and { - acceptProxyProtocol = (node.acceptProxyProtocol and node.acceptProxyProtocol == "1") and true or false, header = { type = node.tcp_guise, request = (node.tcp_guise == "http") and { @@ -453,7 +452,6 @@ function gen_config_server(node) header = {type = node.mkcp_guise} } or nil, wsSettings = (node.transport == "ws") and { - acceptProxyProtocol = (node.acceptProxyProtocol and node.acceptProxyProtocol == "1") and true or false, headers = (node.ws_host) and {Host = node.ws_host} or nil, path = node.ws_path } or nil, @@ -470,7 +468,10 @@ function gen_config_server(node) } or nil, grpcSettings = (node.transport == "grpc") and { serviceName = node.grpc_serviceName - } or nil + } or nil, + sockopt = { + acceptProxyProtocol = (node.acceptProxyProtocol and node.acceptProxyProtocol == "1") and true or false + } } } }, @@ -503,9 +504,7 @@ function gen_config_server(node) node.reality_serverNames }, privateKey = node.reality_private_key, - shortIds = { - node.reality_shortId - } + shortIds = node.reality_shortId or "" } or nil end end