mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6735] [Feature]: Map Shadowsocks TCP HTTP header to Mihomo 'plugin: obfs' instead of dropping the node from the Mihomo subscription #4486
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#4486
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @EmmaHermione on GitHub (Oct 5, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6735
Describe the bug
When generating Clash/Mihomo subscriptions (
/mihomo/<sub-id>or/clash/<sub-id>), any Shadowsocks inbound (both legacy AEAD and 2022 methods) configured with TCP HTTP obfuscation (network: tcpwithheader.type: http) is completely omitted from the resulting YAML.In PR #6508, these nodes were gated and dropped under the rationale that "a node whose tcp/http obfuscation Clash cannot express was emitted anyway ... so drop it".
While this restriction makes sense for discontinued clients like Clash for Windows (which lack built-in obfs), Mihomo (Clash.Meta) natively supports simple-obfs out of the box via
plugin: obfsandplugin-opts: {mode: http, host: ...}without requiring any externalobfs-localexecutable.Because 3x-ui already maintains a dedicated dual-endpoint architecture separating modern Mihomo (
/mihomo/) from legacy clients (/clash-legacy/), enforcing this legacy Clash limitation at the lowest level (applyTransport) unnecessarily strips functional nodes from Mihomo users.How to reproduce the problem
2022-blake3-aes-128-gcmoraes-256-gcm).network) totcp.httpwith a fake host (e.g.,gateway.icloud.com)./mihomo/<sub-id>).proxieslist.Expected behavior
For Mihomo endpoints (
/mihomo/<sub-id>), the Shadowsocks node should be exported with its TCP HTTP header mapped to Mihomo's built-inplugin: obfs, like so:Screenshots
3x-ui version
3.9.0
Xray-core version
26.9.30
How did you install 3x-ui?
install.sh script
Operating system
Debian 13
Which parts of the panel are affected?
Subscription (share links / Clash / JSON)
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@github-actions[bot] commented on GitHub (Oct 5, 2026):
You've read the code correctly: on 3.9.0, and still on the default branch, the Clash/Mihomo subscription leaves out a Shadowsocks inbound that uses a TCP
httpheader. That is a deliberate gate with a test pinning it, not a regression. What you're asking for, mapping the header to Mihomo's built-inplugin: obfs, is a new export mapping, so I've filed this as a feature request.What the code does
buildProxyruns the transport check before the protocol switch, so themodel.Shadowsockscase never runs for such a node (internal/sub/clash_service.go:428):and
applyTransportrejects every non-noneTCP header (internal/sub/clash_service.go:1052-1055):TestApplyTransport_TCPHeader(internal/sub/clash_service_test.go:211-227) pins this on purpose: "tcp + non-none (http) header is not representable in clash and must be rejected". PR #6508 (ff1a6c3c) then routed externalss://links through the same gate. Its description gives the reason: "mihomo cannot express an xraytcpSettings.header.type=httpon a shadowsocks proxy". The check itself is older.git log -Straces it back to the file move in41645255(#5167).Why the request has a basis in the repo (for the maintainer)
That reason conflicts with the panel's own share-link path. For this exact inbound,
genShadowsocksLinkalready writes the header as simple-obfs (internal/sub/service.go:1372-1381):TestShadowsocksTcpHttpHeaderUsesObfsLocalPlugin(internal/sub/characterization_test.go:180) pins this. So the plain-link subscription already treats simple-obfshttpas the client-side match for Xray's TCPhttpheader. The Clash/Mihomo path refuses the same node.Other points that matter for an implementation:
pluginandplugin-optsthrough onssproxies (internal/sub/clash_service.go:232), so/clash-legacy/would pass the new fields on unless they are filtered there.internal/sub/clash_external.go:97-98) uses the sameapplyTransport, so any change applies to both paths.TestApplyTransport_TCPHeaderand the dropped-node expectations inclash_external_quota_test.gowould need to change to match.What I could not confirm
I can't run Xray or Mihomo here. So it is my inference, not a tested result, that Mihomo's built-in obfs HTTP request (fixed
GET /with its own headers) gets through Xray's server-side TCPhttpheader check when the inbound sets a custom request path, method or extra headers. A one-off test against an inbound with a non-/path would settle that.Workaround until then: use the plain subscription or the inbound's
ss://share link, which already carriesplugin=obfs-local;obfs=http;obfs-host=…. Or switch the inbound's TCP header tonone/ use another transport if it has to appear in the Mihomo YAML.I changed the title from "[Bug]: Shadowsocks with TCP HTTP obfs is dropped from Mihomo subscription instead of mapping to native 'plugin: obfs'" to make clear this is a feature request.
Verdict: Feature request
This reply was generated automatically; a maintainer may follow up.