From f85f422a5a3357ca570ff2456da6c36cbcd76306 Mon Sep 17 00:00:00 2001 From: action Date: Sat, 20 Jun 2026 01:51:37 +0800 Subject: [PATCH] update 2026-06-20 01:51:37 --- .../root/usr/share/passwall/clash_subconverter.lua | 4 +++- .../root/usr/share/passwall/subscribe.lua | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/luci-app-passwall/root/usr/share/passwall/clash_subconverter.lua b/luci-app-passwall/root/usr/share/passwall/clash_subconverter.lua index 5ad9444b..c2aaea13 100644 --- a/luci-app-passwall/root/usr/share/passwall/clash_subconverter.lua +++ b/luci-app-passwall/root/usr/share/passwall/clash_subconverter.lua @@ -99,7 +99,9 @@ local function build_common(node) elseif net == "http" then local opts = node["http-opts"] if opts then - o.transport.host = get_first(opts.host) + -- Clash http-opts carries the camouflage Host under headers.Host + -- (a list), like ws-opts; opts.host is not standard for http. + o.transport.host = get_first(opts.host) or (opts.headers and get_first(opts.headers.Host)) o.transport.path = get_first(opts.path) end diff --git a/luci-app-passwall/root/usr/share/passwall/subscribe.lua b/luci-app-passwall/root/usr/share/passwall/subscribe.lua index f7863103..87066bc1 100755 --- a/luci-app-passwall/root/usr/share/passwall/subscribe.lua +++ b/luci-app-passwall/root/usr/share/passwall/subscribe.lua @@ -597,7 +597,16 @@ local function processData(szType, content, add_mode, group, sub_cfg) elseif result.type == "Xray" and info.net == "tcp" then info.net = "raw" end - if info.net == 'h2' or info.net == 'http' then + -- Clash 'network: http' = TCP + HTTP/1.1 header obfuscation (no TLS), + -- i.e. Xray raw transport with tcp header type "http" -- NOT xhttp + -- (splithttp). Normalize to 'raw' + guise 'http' so the tcp_guise + -- block below handles it; the server otherwise replies HTTP 400. + -- 'h2' still maps to xhttp (Xray dropped the standalone h2 transport). + if info.net == 'http' and result.type == "Xray" then + info.net = "raw" + info.type = "http" + result.transport = "raw" + elseif info.net == 'h2' or info.net == 'http' then info.net = "http" result.transport = (result.type == "Xray") and "xhttp" or "http" else