OSDN Git Service

luci-app-ssr-plus: fix v2ray gPRC multi support
authorTianling Shen <cnsztl@immortalwrt.org>
Wed, 8 Jun 2022 10:19:16 +0000 (18:19 +0800)
committerTianling Shen <cnsztl@immortalwrt.org>
Wed, 8 Jun 2022 10:27:07 +0000 (18:27 +0800)
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
applications/luci-app-ssr-plus/Makefile
applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua
applications/luci-app-ssr-plus/po/zh_Hans/ssr-plus.po
applications/luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua

index 5c0ae1f..b009926 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=luci-app-ssr-plus
 PKG_VERSION:=186
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_CONFIG_DEPENDS:= \
        CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun \
index 65f82e0..401f6d4 100644 (file)
@@ -438,6 +438,14 @@ o = s:option(Value, "serviceName", translate("gRPC Service Name"))
 o:depends("transport", "grpc")
 o.rmempty = true
 
+-- 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"))
+o.rmempty = true
+
 -- gRPC初始窗口
 o = s:option(Value, "initial_windows_size", translate("Initial Windows Size"))
 o.datatype = "uinteger"
index 4e979db..1d1b7a5 100644 (file)
@@ -739,6 +739,9 @@ msgstr "HTTP/2 路径"
 msgid "gRPC Service Name"
 msgstr "gRPC 服务名称"
 
+msgid "gRPC Mode"
+msgstr "gRPC 模式"
+
 msgid "Initial Windows Size"
 msgstr "初始窗口大小"
 
index c1d4f44..420e403 100755 (executable)
@@ -181,11 +181,11 @@ local Xray = {
                        } or nil,
                        wsSettings = (server.transport == "ws") and (server.ws_path or server.ws_host or server.tls_host) and {
                                -- ws
-                               path = server.ws_path,
                                headers = (server.ws_host or server.tls_host) and {
                                        -- headers
                                        Host = server.ws_host or server.tls_host
                                } or nil,
+                               path = server.ws_path,
                                maxEarlyData = tonumber(server.ws_ed) or nil,
                                earlyDataHeaderName = server.ws_ed_header or nil
                        } or nil,
@@ -205,7 +205,7 @@ local Xray = {
                        grpcSettings = (server.transport == "grpc") and {
                                -- grpc
                                serviceName = server.serviceName or "",
-                               multiMode = (server.mux == "1") and true or false,
+                               mode = (server.grpc_mode ~= "gun") and server.grpc_mode or nil,
                                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,