🗽 Sync 2026-10-23 00:46:23

This commit is contained in:
github-actions[bot] committed 2026-10-23 00:46:23 +08:00
1 parent 6032a57538
commit 2b29b0c4e1
112 files changed
+1859 -6208

No files matched your search

@@ -364,41 +364,41 @@ function outbound:handleIndex(index)
trojan_shadowsocks()
end,
snell = function()
outbound_settings = {
address = server.server, port = tonumber(server.server_port),
psk = server.snell_psk, version = tonumber(server.snell_version) or 4,
obfs = server.snell_obfs or "", obfsHost = server.snell_obfs_host,
reuse = server.snell_reuse == "1"
}
end,
outbound_settings = {
address = server.server, port = tonumber(server.server_port),
psk = server.snell_psk, version = tonumber(server.snell_version) or 4,
obfs = server.snell_obfs or "", obfsHost = server.snell_obfs_host,
reuse = server.snell_reuse == "1"
}
end,
tuic = function()
local version = tonumber(server.xray_tuic_version) or 5
local alpn = {}
for value in (server.tuic_alpn or ""):gmatch("[^,]+") do alpn[#alpn + 1] = value end
if #alpn == 0 then alpn = {"h3"} end
outbound_settings = {
address = server.server, port = tonumber(server.server_port), version = version,
token = version == 4 and server.xray_tuic_token or nil,
uuid = version == 5 and server.tuic_uuid or nil,
password = version == 5 and server.tuic_passwd or nil,
serverName = server.tls_host, certificateFile = server.xray_tuic_ca,
allowInsecure = server.insecure == "1",
alpn = alpn,
congestionControl = server.congestion_control or "cubic",
udpRelayMode = server.udp_relay_mode or "native",
heartbeatInterval = (tonumber(server.heartbeat) or 10) * 1000,
requestTimeout = (tonumber(server.timeout) or 8) * 1000,
reduceRtt = server.zero_rtt_handshake == "1"
}
end,
local version = tonumber(server.xray_tuic_version) or 5
local alpn = {}
for value in (server.tuic_alpn or ""):gmatch("[^,]+") do alpn[#alpn + 1] = value end
if #alpn == 0 then alpn = {"h3"} end
outbound_settings = {
address = server.server, port = tonumber(server.server_port), version = version,
token = version == 4 and server.xray_tuic_token or nil,
uuid = version == 5 and server.tuic_uuid or nil,
password = version == 5 and server.tuic_passwd or nil,
serverName = server.tls_host, certificateFile = server.xray_tuic_ca,
allowInsecure = server.insecure == "1",
alpn = alpn,
congestionControl = server.congestion_control or "cubic",
udpRelayMode = server.udp_relay_mode or "native",
heartbeatInterval = (tonumber(server.heartbeat) or 10) * 1000,
requestTimeout = (tonumber(server.timeout) or 8) * 1000,
reduceRtt = server.zero_rtt_handshake == "1"
}
end,
shadowsocksr = function()
outbound_settings = {
address = server.server, port = tonumber(server.server_port),
password = server.password, method = server.ssr_method or "aes-128-cfb",
protocol = server.ssr_protocol or "origin", protocolParam = server.protocol_param,
obfs = server.ssr_obfs or "plain", obfsParam = server.obfs_param
}
end,
outbound_settings = {
address = server.server, port = tonumber(server.server_port),
password = server.password, method = server.ssr_method or "aes-128-cfb",
protocol = server.ssr_protocol or "origin", protocolParam = server.protocol_param,
obfs = server.ssr_obfs or "plain", obfsParam = server.obfs_param
}
end,
shadowsocks = function()
trojan_shadowsocks()
end,
@@ -412,18 +412,18 @@ function outbound:handleIndex(index)
wireguard()
end,
naive = function()
outbound_settings = {
address = server.server, port = tonumber(server.server_port),
username = server.username, password = server.password,
serverName = server.tls_host,
certificateFile = server.naive_certificate_file,
quic = server.naive_quic == "1",
udpOverTcp = server.naive_udp_over_tcp == "1",
insecureConcurrency = tonumber(server.naive_concurrency),
quicCongestionControl = server.naive_quic_congestion,
echConfigList = server.naive_ech_config
}
end,
outbound_settings = {
address = server.server, port = tonumber(server.server_port),
username = server.username, password = server.password,
serverName = server.tls_host,
certificateFile = server.naive_certificate_file,
quic = server.naive_quic == "1",
udpOverTcp = server.naive_udp_over_tcp == "1",
insecureConcurrency = tonumber(server.naive_concurrency),
quicCongestionControl = server.naive_quic_congestion,
echConfigList = server.naive_ech_config
}
end,
anytls = function()
outbound_settings = {
address = server.server,
@@ -930,48 +930,48 @@ Xray.outbounds = {
-- These protocols own their framing, obfuscation and multiplexing.
-- Preserve Xray socket marks and dialer chains.
if server.v2ray_protocol == "naive" or server.v2ray_protocol == "shadowsocksr" or server.v2ray_protocol == "tuic" or server.v2ray_protocol == "snell" then
local ob = Xray.outbounds[1]
ob.streamSettings = { network = "raw", sockopt = ob.streamSettings.sockopt }
ob.mux = nil
local ob = Xray.outbounds[1]
ob.streamSettings = { network = "raw", sockopt = ob.streamSettings.sockopt }
ob.mux = nil
end
if server.type == "v2ray" and server.transport == "kcptun" then
local supported = {vmess = true, vless = true, trojan = true, shadowsocks = true, socks = true, http = true}
assert(supported[server.v2ray_protocol], "Kcptun requires a supported stream proxy protocol")
assert(server.tls ~= "1" and server.reality ~= "1" and server.xtls ~= "1", "Kcptun cannot be combined with stream TLS or REALITY")
assert(server.kcp_enable ~= "1", "Native Kcptun cannot be combined with the external Kcptun client")
assert(not server.tls_flow or server.tls_flow == "", "Kcptun cannot be combined with XTLS flow")
local options = {}
if server.xray_kcptun_options and server.xray_kcptun_options:match("%S") then
assert(server.xray_kcptun_options:match("^%s*{"), "Kcptun options must be a JSON object")
options = json.parse(server.xray_kcptun_options)
assert(type(options) == "table", "Kcptun options must be a JSON object")
end
options.key = server.xray_kcptun_key
options.crypt = server.xray_kcptun_crypt or "aes"
options.mode = server.xray_kcptun_mode or "fast"
options.smuxver = tonumber(server.xray_kcptun_smuxver) or 1
options.nocomp = server.xray_kcptun_nocomp == "1"
options.conn = tonumber(server.xray_kcptun_conn) or 1
Xray.outbounds[1].streamSettings.kcptunSettings = options
local supported = {vmess = true, vless = true, trojan = true, shadowsocks = true, socks = true, http = true}
assert(supported[server.v2ray_protocol], "Kcptun requires a supported stream proxy protocol")
assert(server.tls ~= "1" and server.reality ~= "1" and server.xtls ~= "1", "Kcptun cannot be combined with stream TLS or REALITY")
assert(server.kcp_enable ~= "1", "Native Kcptun cannot be combined with the external Kcptun client")
assert(not server.tls_flow or server.tls_flow == "", "Kcptun cannot be combined with XTLS flow")
local options = {}
if server.xray_kcptun_options and server.xray_kcptun_options:match("%S") then
assert(server.xray_kcptun_options:match("^%s*{"), "Kcptun options must be a JSON object")
options = json.parse(server.xray_kcptun_options)
assert(type(options) == "table", "Kcptun options must be a JSON object")
end
options.key = server.xray_kcptun_key
options.crypt = server.xray_kcptun_crypt or "aes"
options.mode = server.xray_kcptun_mode or "fast"
options.smuxver = tonumber(server.xray_kcptun_smuxver) or 1
options.nocomp = server.xray_kcptun_nocomp == "1"
options.conn = tonumber(server.xray_kcptun_conn) or 1
Xray.outbounds[1].streamSettings.kcptunSettings = options
end
if server.type == "v2ray" and server.xray_shadowtls == "1" then
local supported = {vmess = true, vless = true, trojan = true, shadowsocks = true}
assert(supported[server.v2ray_protocol], "ShadowTLS requires a supported TCP proxy protocol")
assert((server.transport or "raw") == "raw" or server.transport == "tcp", "ShadowTLS requires RAW/TCP")
assert(server.tls ~= "1" and server.reality ~= "1", "ShadowTLS cannot be combined with TLS or REALITY")
assert(not server.tls_flow or server.tls_flow == "", "ShadowTLS cannot be combined with XTLS flow")
local stream = Xray.outbounds[1].streamSettings
stream.security = "shadowtls"
stream.shadowtlsSettings = {
version = tonumber(server.xray_shadowtls_version) or 3,
password = server.xray_shadowtls_password,
serverName = server.xray_shadowtls_sni,
fingerprint = server.xray_shadowtls_fingerprint or "chrome",
strictMode = server.xray_shadowtls_strict ~= "0",
allowInsecure = server.xray_shadowtls_insecure == "1"
}
local supported = {vmess = true, vless = true, trojan = true, shadowsocks = true}
assert(supported[server.v2ray_protocol], "ShadowTLS requires a supported TCP proxy protocol")
assert((server.transport or "raw") == "raw" or server.transport == "tcp", "ShadowTLS requires RAW/TCP")
assert(server.tls ~= "1" and server.reality ~= "1", "ShadowTLS cannot be combined with TLS or REALITY")
assert(not server.tls_flow or server.tls_flow == "", "ShadowTLS cannot be combined with XTLS flow")
local stream = Xray.outbounds[1].streamSettings
stream.security = "shadowtls"
stream.shadowtlsSettings = {
version = tonumber(server.xray_shadowtls_version) or 3,
password = server.xray_shadowtls_password,
serverName = server.xray_shadowtls_sni,
fingerprint = server.xray_shadowtls_fingerprint or "chrome",
strictMode = server.xray_shadowtls_strict ~= "0",
allowInsecure = server.xray_shadowtls_insecure == "1"
}
end
if xray_builtin_dns then
@@ -1390,13 +1390,13 @@ function config:handleIndex(index)
end
end,
snell = function()
outbound_settings = {
address = server.server, port = tonumber(server.server_port),
psk = server.snell_psk, version = tonumber(server.snell_version) or 4,
obfs = server.snell_obfs or "", obfsHost = server.snell_obfs_host,
reuse = server.snell_reuse == "1"
}
end,
outbound_settings = {
address = server.server, port = tonumber(server.server_port),
psk = server.snell_psk, version = tonumber(server.snell_version) or 4,
obfs = server.snell_obfs or "", obfsHost = server.snell_obfs_host,
reuse = server.snell_reuse == "1"
}
end,
tuic = function()
print(json.stringify(tuic, 1))
end