mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6326] [MERGED] feat(sub): add AmneziaWG proxy generation for Clash subscriptions #6219
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#6219
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/6326
Author: @VibeProgramm
Created: 8/25/2026
Status: ✅ Merged
Merged: 9/10/2026
Merged by: @MHSanaei
Base:
main← Head:feat/amneziawg-clash-subscription📝 Commits (6)
e45d74afeat(sub): add AmneziaWG proxy generation for Clash subscriptions88889bffix review nits: doc comment and test calla8a4bf8fix(sub): use the AmneziaWG inbound's own tunnel address in Clash proxies5220dbaMerge remote-tracking branch 'origin/main' into pr/632646fd2f5fix(sub): emit the AmneziaWG effective MTU in Clash proxiesba18727fix(sub): reject a zoned DNS address before opting into remote-dns-resolve📊 Changes
2 files changed (+584 additions, -0 deletions)
View changed files
📝
internal/sub/clash_service.go(+185 -0)📝
internal/sub/clash_service_test.go(+399 -0)📄 Description
Summary
Add
buildAmneziaWGProxyto generate mihomo-compatible wireguard proxy entries withamnezia-wg-optionsub-block for AmneziaWG inbounds in Clash subscriptions.Why
Previously, AmneziaWG inbounds were silently skipped in Clash subscriptions (
buildProxyreturned nil), making them unusable with mihomo/Clash clients. This fixes #6310.Type of change
Areas affected
How was this tested?
go build ./...— passesgo test ./internal/sub/ -run AmneziaWG -v— 3 new tests pass:TestBuildAmneziaWGProxyForClash— v1.0 obfuscation fieldsTestBuildAmneziaWGProxyForClashV3— v3 fields (headerProtectionKey, randomTrailers, etc.)TestBuildAmneziaWGProxyForClashNoKey— nil when client has no keygo vet ./internal/sub/— no issuesmake gen-check— passesWhat the Clash YAML output looks like
Breaking changes
None.
Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass.Closes #6310
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.