feat(sub): map shadowsocks TCP HTTP headers to Mihomo's obfs plugin (#6838)

A shadowsocks inbound with a TCP HTTP header was dropped from Mihomo
subscriptions, although Mihomo's simple-obfs speaks the same wire format
(#6735). Such a node is now emitted with plugin: obfs, mode http and the request
Host header. Mihomo always requests GET /, and xray-core rejects a request whose
path is not one of the header's paths, so only headers that accept / map;
others stay dropped, as do non-shadowsocks protocols and the legacy Clash
endpoint.
This commit is contained in:
Emma Hermione
2026-10-24 13:10:30 +08:00
committed by GitHub
parent 2b759f3916
commit 0b90dc2bed
4 changed files with 199 additions and 11 deletions
@@ -30,7 +30,7 @@ func TestClashExternalShadowsocksMatchesInboundPath(t *testing.T) {
name: "tcp http header",
stream: `{"network":"tcp","security":"none","tcpSettings":{"header":{"type":"http","request":{"path":["/"],"headers":{"Host":["test"]}}}}}`,
link: "ss://" + userinfo + "@203.0.113.1:8443?type=tcp&headerType=http&host=test#ss",
wantDropped: true,
wantDropped: false,
},
{
name: "tls",