🔥 Sync 2026-07-31 20:41:05

This commit is contained in:
github-actions[bot] committed 2026-07-31 20:41:05 +08:00
1 parent d1ded93052
commit 3692297595
20 files changed
+253 -86

No files matched your search

@@ -7,6 +7,8 @@ local urlencode = api.UrlEncode
local base64 = api.base64Encode
local json = api.jsonc
local domain_redir = {}
local function host_format(host)
if not host then return "" end
local str = host:match("%[(.-)%]") or host
@@ -162,7 +164,7 @@ local function build_common(node)
local d = opts["download-settings"]
local ds = {}
if d.server then ds.address = d.server end
if d.server then ds.address = domain_redir[d.server] or d.server end
if d.port then ds.port = d.port end
ds.network = "xhttp"
@@ -507,6 +509,8 @@ local function encode_node(node)
local t = node.type
node.server = domain_redir[node.server] or node.server
if t == "vless" then return encode_vless(node)
elseif t == "trojan" then return encode_trojan(node)
elseif t == "vmess" then return encode_vmess(node)
@@ -531,6 +535,15 @@ function parseClashNode(raw, remark)
api.log('检测到 Clash 订阅,正在进行转换 ...')
-- Some airports use hosts domain redirect to disguise the real node domain name.
for k, v in pairs(data.hosts or {}) do
if type(k) == "string" and type(v) == "string" then
if api.datatypes.hostname(k) and api.datatypes.hostname(v) then
domain_redir[k] = v
end
end
end
local links = {}
for _, node in ipairs(data.proxies) do
local err, link = encode_node(node)
@@ -330,11 +330,16 @@ end
--中国列表
if CHNLIST ~= "0" and is_file_nonzero(RULES_PATH .. "/chnlist") then
if CHNLIST == "direct" then
local sets = {
setflag .. "psw_chn",
setflag .. "psw_chn6"
}
local suffix = (NFTFLAG == "1") and "_static" or ""
tmp_lines = {
"chnlist-file " .. RULES_PATH .. "/chnlist",
"ipset-name4 " .. setflag .. "psw_chn",
"ipset-name6 " .. setflag .. "psw_chn6",
"add-tagchn-ip",
"ipset-name4 " .. setflag .. "psw_chn" .. suffix,
"ipset-name6 " .. setflag .. "psw_chn6" .. suffix,
"add-tagchn-ip" .. ((NFTFLAG == "1") and (" " .. table.concat(sets, ",")) or ""),
"chnlist-first"
}
merge_array(config_lines, tmp_lines)