浏览代码

luci-app-ssr-plus: fix subscribe bugs about grpc and sni

Signed-off-by: Tianling Shen <[email protected]>
Chikage0o0 3 年之前
父节点
当前提交
436844357f
共有 1 个文件被更改,包括 12 次插入1 次删除
  1. 12 1
      luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua

+ 12 - 1
luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua

@@ -192,6 +192,13 @@ local function processData(szType, content)
 			result.read_buffer_size = 2
 			result.write_buffer_size = 2
 		end
+		if info.net == 'grpc' then
+			if info.path then
+				result.serviceName = info.path
+			elseif info.serviceName then
+				result.serviceName = info.serviceName
+			end
+		end
 		if info.net == 'quic' then
 			result.quic_guise = info.type
 			result.quic_key = info.key
@@ -202,7 +209,11 @@ local function processData(szType, content)
 		end
 		if info.tls == "tls" or info.tls == "1" then
 			result.tls = "1"
-			result.tls_host = info.host
+			if info.sni then
+				result.tls_host = info.sni
+			elseif info.host then
+				result.tls_host = info.host
+			end
 			result.insecure = 1
 		else
 			result.tls = "0"