luci-app-ssr-plus: add alpn settings

Fixes: #973

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2022-12-08 06:31:59 +08:00 committed by sbwml
parent 3835c26c9c
commit 43d6fcd02f
2 changed files with 23 additions and 8 deletions

View File

@ -688,6 +688,11 @@ o:depends("xtls", true)
o:depends("type", "hysteria")
o.rmempty = true
o = s:option(DynamicList, "tls_alpn", translate("TLS ALPN"))
o:depends("tls", true)
o:depends("xtls", true)
o.rmempty = true
o = s:option(Value, "quic_tls_alpn", translate("QUIC TLS ALPN"))
o:depends("type", "hysteria")
o.rmempty = true

View File

@ -160,16 +160,26 @@ local Xray = {
security = (server.xtls == '1') and "xtls" or (server.tls == '1') and "tls" or nil,
tlsSettings = (server.tls == '1' and (server.insecure == "1" or server.tls_host or server.fingerprint)) and {
-- tls
fingerprint = server.fingerprint,
allowInsecure = (server.insecure == "1") and true or nil,
serverName = server.tls_host
} or nil,
xtlsSettings = (server.xtls == '1' and (server.insecure == "1" or server.tls_host or server.fingerprint)) and {
-- xtls
alpn = server.tls_alpn,
fingerprint = server.fingerprint,
allowInsecure = (server.insecure == "1") and true or nil,
serverName = server.tls_host,
minVersion = "1.3"
certificates = server.certificate and {
usage = "verify",
certificateFile = server.certpath
} or nil
} or nil,
xtlsSettings = (server.xtls == '1' and (server.insecure == "1" or server.tls_host or server.fingerprint)) and {
-- xtls
alpn = server.tls_alpn,
fingerprint = server.fingerprint,
allowInsecure = (server.insecure == "1") and true or nil,
serverName = server.tls_host,
minVersion = "1.3",
certificates = server.certificate and {
usage = "verify",
certificateFile = server.certpath
} or nil
} or nil,
tcpSettings = (server.transport == "tcp" and server.tcp_guise == "http") and {
-- tcp
@ -255,7 +265,7 @@ local trojan = {
cipher = cipher,
cipher_tls13 = cipher13,
sni = server.tls_host,
alpn = {"h2", "http/1.1"},
alpn = server.tls_alpn or {"h2", "http/1.1"},
curve = "",
reuse_session = true,
session_ticket = (server.tls_sessionTicket == "1") and true or false