luci-app-ssr-plus: add vless gRPC support

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Mattraks 2021-05-06 14:51:29 +08:00 committed by Tianling Shen
parent 5c47167b31
commit 2e3eee376e
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
6 changed files with 23 additions and 4 deletions

View File

@ -332,6 +332,7 @@ o:value("kcp", "mKCP")
o:value("ws", "WebSocket")
o:value("h2", "HTTP/2")
o:value("quic", "QUIC")
o:value("grpc", "gRPC")
o.rmempty = true
o:depends("type", "v2ray")
@ -381,6 +382,11 @@ o = s:option(Value, "h2_path", translate("HTTP/2 Path"))
o:depends("transport", "h2")
o.rmempty = true
-- gRPC
o = s:option(Value, "serviceName", translate("serviceName"))
o:depends("transport", "grpc")
o.rmempty = true
-- [[ QUIC部分 ]]--
o = s:option(ListValue, "quic_security", translate("QUIC Security"))
o:depends("transport", "quic")

View File

@ -338,6 +338,9 @@ function import_ssr_url(btn, urlname, sid) {
document.getElementsByName('cbid.shadowsocksr.' + sid + '.quic_security')[0].value = queryParam.quicSecurity || "none";
document.getElementsByName('cbid.shadowsocksr.' + sid + '.quic_key')[0].value = queryParam.key;
break;
case "grpc":
document.getElementsByName('cbid.shadowsocksr.' + sid + '.serviceName')[0].value = queryParam.serviceName;
break;
default:
if (queryParam.security == "xtls") {
document.getElementsByName('cbid.shadowsocksr.' + sid + '.xtls')[0].checked = true;

View File

@ -1712,7 +1712,6 @@
59.153.116.0/22
59.153.136.0/22
59.153.152.0/22
59.153.156.0/22
59.153.164.0/22
59.153.168.0/22
59.153.172.0/22
@ -4144,6 +4143,8 @@
103.166.50.0/23
103.166.52.0/23
103.166.54.0/23
103.166.84.0/23
103.166.138.0/23
103.192.0.0/22
103.192.4.0/22
103.192.8.0/22
@ -4215,7 +4216,6 @@
103.198.156.0/22
103.198.180.0/22
103.198.196.0/22
103.198.200.0/22
103.198.216.0/22
103.198.220.0/22
103.198.224.0/22

View File

@ -9440,6 +9440,8 @@ server=/hpto.net/127.0.0.1#5335
ipset=/hpto.net/gfwlist
server=/pricelesshonolulu.com/127.0.0.1#5335
ipset=/pricelesshonolulu.com/gfwlist
server=/facebook-hardware.com/127.0.0.1#5335
ipset=/facebook-hardware.com/gfwlist
server=/adblockplus.org/127.0.0.1#5335
ipset=/adblockplus.org/gfwlist
server=/shopee.co.id/127.0.0.1#5335

View File

@ -117,7 +117,7 @@ local Xray = {
-- 底层传输配置
streamSettings = {
network = server.transport or "tcp",
security = (server.xtls == '1') and "xtls" or (server.tls == '1') and "tls" or nil,
security = (server.xtls == '1') and "xtls" or (server.tls == '1'or server.transport == "grpc") and "tls" or nil,
tlsSettings = (server.tls == '1' and (server.insecure == "1" or server.tls_host or server.fingerprint)) and {
-- tls
fingerprint = server.fingerprint,
@ -169,9 +169,14 @@ local Xray = {
security = server.quic_security,
key = server.quic_key,
header = {type = server.quic_guise}
} or nil,
grpcSettings = (server.transport == "grpc") and {
-- grpc
serviceName = server.serviceName or "",
multiMode = (server.mux == "1") and true or false
} or nil
},
mux = (server.mux == "1" and server.xtls ~= "1") and {
mux = (server.mux == "1" and server.xtls ~= "1" and server.transport ~= "grpc") and {
-- mux
enabled = true,
concurrency = tonumber(server.concurrency)

View File

@ -352,6 +352,9 @@ local function processData(szType, content)
result.quic_key = params.key
result.quic_security = params.quicSecurity or "none"
end
if params.type == 'grpc' then
result.serviceName = params.serviceName
end
if params.security == "tls" then
result.tls = "1"
result.tls_host = params.sni or host[1]