update 2026-06-20 01:51:37

This commit is contained in:
action 2026-06-20 01:51:37 +08:00
parent 1ec80fbc61
commit f85f422a5a
2 changed files with 13 additions and 2 deletions

View File

@ -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

View File

@ -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