update 2024-08-10 16:21:02

This commit is contained in:
kenzok8 2024-08-10 16:21:02 +08:00
parent b86af1f8c1
commit d5318c5af2
5 changed files with 48 additions and 2 deletions

View File

@ -341,9 +341,12 @@ o:depends({ [option_name("tls")] = true, [option_name("transport")] = "grpc" })
o = s:option(ListValue, option_name("alpn"), translate("alpn"))
o.default = "default"
o:value("default", translate("Default"))
o:value("h2,http/1.1")
o:value("h3")
o:value("h2")
o:value("h3,h2")
o:value("http/1.1")
o:value("h2,http/1.1")
o:value("h3,h2,http/1.1")
o:depends({ [option_name("tls")] = true, [option_name("reality")] = false })
-- o = s:option(Value, option_name("minversion"), translate("minversion"))
@ -397,6 +400,7 @@ o:value("ds", "DomainSocket")
o:value("quic", "QUIC")
o:value("grpc", "gRPC")
o:value("httpupgrade", "HttpUpgrade")
o:value("splithttp", "SplitHTTP")
o:depends({ [option_name("protocol")] = "vmess" })
o:depends({ [option_name("protocol")] = "vless" })
o:depends({ [option_name("protocol")] = "socks" })
@ -562,6 +566,14 @@ o = s:option(Value, option_name("httpupgrade_path"), translate("HttpUpgrade Path
o.placeholder = "/"
o:depends({ [option_name("transport")] = "httpupgrade" })
-- [[ SplitHTTP部分 ]]--
o = s:option(Value, option_name("splithttp_host"), translate("SplitHTTP Host"))
o:depends({ [option_name("transport")] = "splithttp" })
o = s:option(Value, option_name("splithttp_path"), translate("SplitHTTP Path"))
o.placeholder = "/"
o:depends({ [option_name("transport")] = "splithttp" })
-- [[ Mux ]]--
o = s:option(Flag, option_name("mux"), translate("Mux"))
o:depends({ [option_name("protocol")] = "vmess" })

View File

@ -154,9 +154,12 @@ o:depends({ [option_name("reality")] = true })
o = s:option(ListValue, option_name("alpn"), translate("alpn"))
o.default = "h2,http/1.1"
o:value("h2,http/1.1")
o:value("h3")
o:value("h2")
o:value("h3,h2")
o:value("http/1.1")
o:value("h2,http/1.1")
o:value("h3,h2,http/1.1")
o:depends({ [option_name("tls")] = true })
-- o = s:option(Value, option_name("minversion"), translate("minversion"))
@ -203,6 +206,7 @@ o:value("ds", "DomainSocket")
o:value("quic", "QUIC")
o:value("grpc", "gRPC")
o:value("httpupgrade", "HttpUpgrade")
o:value("splithttp", "SplitHTTP")
o:depends({ [option_name("protocol")] = "vmess" })
o:depends({ [option_name("protocol")] = "vless" })
o:depends({ [option_name("protocol")] = "socks" })
@ -225,6 +229,14 @@ o = s:option(Value, option_name("httpupgrade_path"), translate("HttpUpgrade Path
o.placeholder = "/"
o:depends({ [option_name("transport")] = "httpupgrade" })
-- [[ SplitHTTP部分 ]]--
o = s:option(Value, option_name("splithttp_host"), translate("SplitHTTP Host"))
o:depends({ [option_name("transport")] = "splithttp" })
o = s:option(Value, option_name("splithttp_path"), translate("SplitHTTP Path"))
o.placeholder = "/"
o:depends({ [option_name("transport")] = "splithttp" })
-- [[ HTTP/2部分 ]]--
o = s:option(Value, option_name("h2_host"), translate("HTTP/2 Host"))

View File

@ -205,6 +205,10 @@ function gen_outbound(flag, node, tag, proxy_table)
path = node.httpupgrade_path or "/",
host = node.httpupgrade_host
} or nil,
splithttpSettings = (node.transport == "splithttp") and {
path = node.splithttp_path or "/",
host = node.splithttp_host
} or nil,
} or nil,
settings = {
vnext = (node.protocol == "vmess" or node.protocol == "vless") and {
@ -481,6 +485,10 @@ function gen_config_server(node)
path = node.httpupgrade_path or "/",
host = node.httpupgrade_host
} or nil,
splithttpSettings = (node.transport == "splithttp") and {
path = node.splithttp_path or "/",
host = node.splithttp_host
} or nil,
sockopt = {
acceptProxyProtocol = (node.acceptProxyProtocol and node.acceptProxyProtocol == "1") and true or false
}

View File

@ -310,6 +310,10 @@ local api = require "luci.passwall.api"
params += opt.query("path", dom_prefix + "grpc_serviceName");
params += opt.query("serviceName", dom_prefix + "grpc_serviceName");
params += opt.query("mode", dom_prefix + "grpc_mode");
} else if (v_transport === "splithttp") {
v_transport = "splithttp";
params += opt.query("host", dom_prefix + "splithttp_host");
params += opt.query("path", dom_prefix + "splithttp_path");
}
params += "&type=" + v_transport;
@ -336,6 +340,7 @@ local api = require "luci.passwall.api"
params += "&flow=" + v_flow;
}
params += "&security=" + v_security;
params += opt.query("alpn", dom_prefix + "alpn");
params += opt.query("sni", dom_prefix + "tls_serverName");
}
@ -859,6 +864,7 @@ local api = require "luci.passwall.api"
opt.set(dom_prefix + 'tls', true);
opt.set(dom_prefix + 'reality', false)
opt.set(dom_prefix + 'flow', queryParam.flow || '');
opt.set(dom_prefix + 'alpn', queryParam.alpn || '');
opt.set(dom_prefix + 'tls_serverName', queryParam.sni || '');
opt.set(dom_prefix + 'tls_allowInsecure', true);
if (queryParam.allowinsecure === '0') {
@ -929,6 +935,9 @@ local api = require "luci.passwall.api"
} else if (queryParam.type === "grpc") {
opt.set(dom_prefix + 'grpc_serviceName', (queryParam.serviceName || queryParam.path) || "");
opt.set(dom_prefix + 'grpc_mode', queryParam.mode);
} else if (queryParam.type === "splithttp") {
opt.set(dom_prefix + 'splithttp_host', queryParam.host || "");
opt.set(dom_prefix + 'splithttp_path', queryParam.path || "");
}
if (m.hash) {

View File

@ -866,6 +866,10 @@ local function processData(szType, content, add_mode, add_from)
if params.serviceName then result.grpc_serviceName = params.serviceName end
result.grpc_mode = params.mode
end
if params.type == 'splithttp' then
result.splithttp_host = params.host
result.splithttp_path = params.path
end
result.encryption = params.encryption or "none"
@ -875,6 +879,7 @@ local function processData(szType, content, add_mode, add_from)
if params.security == "tls" or params.security == "reality" then
result.tls = "1"
result.tls_serverName = (params.sni and params.sni ~= "") and params.sni or params.host
result.alpn = params.alpn
result.fingerprint = (params.fp and params.fp ~= "") and params.fp or "chrome"
if params.security == "reality" then
result.reality = "1"