mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #6838] [MERGED] feat(sub): map shadowsocks tcp http header to mihomo obfs plugin #6475
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#6475
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?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6838
Author: @EmmaHermione
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @MHSanaei
Base:
main← Head:feat/mihomo-ss-tcp-http-obfs📝 Commits (5)
0337713feat(sub): map shadowsocks tcp http header to mihomo obfs plugin14269b7Merge remote-tracking branch 'origin/main' into pr/68381e8ec69fix(sub): map shadowsocks HTTP headers to obfs only when they accept /f4f14c9Merge remote-tracking branch 'origin/main' into pr/6838c3d5788style(sub): group the kcp fixture constants for gofumpt📊 Changes
4 files changed (+199 additions, -11 deletions)
View changed files
📝
internal/sub/clash_external_quota_test.go(+7 -7)📝
internal/sub/clash_external_shadowsocks_test.go(+1 -1)📝
internal/sub/clash_service.go(+65 -3)📝
internal/sub/clash_service_test.go(+126 -0)📄 Description
Summary
Resolves #6735.
Maps Shadowsocks inbounds and external links configured with TCP HTTP obfuscation (
network: tcpwithheader.type: http) to Mihomo's built-inplugin: obfs(mode: http, host: ...) instead of dropping the proxy entirely from/mihomo/subscriptions.Why
plugin: obfswithout requiring external binaries.genShadowsocksLink) already re-encodes this exact configuration intoplugin=obfs-local;obfs=http;obfs-host=...(pinned byTestShadowsocksTcpHttpHeaderUsesObfsLocalPlugin). This PR aligns the Mihomo/Clash subscription path with that existing behavior.buildProxy) and external share links (clashProxyFromExternal) remain in complete lockstep parity.Type of change
Areas affected
How was this tested?
Targeted Unit Tests:
Executed the relevant test suite verifying both inbound and external link paths:
go test -v ./internal/sub/ -run "TestClashExternalShadowsocksMatchesInboundPath|TestApplyTransport_TCPHeader|TestClashQuotaHeaderCountsDroppedExternalLink|TestClashAllUnrepresentableNodesAnswerAlike"Package-level Test Suite:
Ran the entire subscription package test suite to verify zero regressions:
go test ./internal/sub/All test cases passed cleanly.
Code Quality & Linting:
Executed standard formatting and static analysis:
gofmt -s -w internal/sub/go vet ./internal/sub/Clean output with zero issues.
Screenshots / recordings
N/A (subscription backend logic change, no UI changes).
Breaking changes
None. Existing working subscriptions remain unaffected. Shadowsocks nodes configured with TCP HTTP obfuscation that were previously omitted from Mihomo subscriptions are now properly exported with native plugin: obfs.
Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.