3x-ui/internal
Rouzbeh† d5ab84e8d5
feat(amneziawg): add AmneziaWG as an outbound protocol (#6320)
* feat(amneziawg): add AmneziaWG as an outbound protocol

- AmneziaWG outbound protocol end-to-end: config schema, socks bridge, netstack, panel UI
- Route amneziawg outbounds to HTTP probe in TCP mode (backend + frontend classifiers) with pinning test
- Add 2-minute idle read deadline to pumpUDPEgress to reap idle egress sessions
- Require SOCKS5 username/password auth on the egress server (reject NO-AUTH with 0xFF) with test
- Bound the egress TCP tunnel dial with portForwardDialTimeout (10s), matching portfwd.go
- Resolve UDP domain targets off the association's reader loop via deliverUDPDatagram; race-safe getOrDial starts the reply pump at session creation; client passed by value into resolver goroutines (pinned by TestEgressUDPDatagramDomainInterleavedClients)
- Reconcile early-returns on an empty desired set and closes the egress listener; EgressBasePort (64900) is reserved against local inbound port conflicts like the internal API port, with pinning tests for both the port reservation (TestCheckPortConflict_EgressPortBlockedLocal) and the Reconcile empty-desired Close/Listen lifecycle (TestOutboundManagerReconcileEmptyDesiredClosesEgress)
- Eliminate acceptLoop shutdown race by validating listener != nil and registering to tracked under s.mu before wg.Add; bound pre-auth handshake with deadline (pinned by TestEgressServerCloseDuringConcurrentAccepts)
- Support AAAA and dual-stack domain resolution in tunnel DNS resolver with v6 default fallback (DefaultTunnelDNSServerV6); add DNS field to frontend protocol form; avoid unneeded cache flushes on unchanged SetStack ticks

* fix(amneziawg): resolve IPv6-only DNS default fallback and validate required keys

- Default to IPv6 tunnel DNS on IPv6-only outbounds with blank dns
- Require non-empty secretKey and peer publicKey in ValidateAmneziaWGOutbound
- Add end-to-end IPv6 tunnel domain resolution test and test empty key rejection
- Trim comment blocks exceeding 2 lines across modified files
- Fix Storybook test execution on environments with POSIX locale

Co-Authored-By: Claude Code <noreply@anthropic.com>

---------

Co-authored-by: rqzbeh <rqzbeh@users.noreply.github.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>
2026-09-10 14:50:48 +02:00
..
amneziawg feat(amneziawg): add AmneziaWG as an outbound protocol (#6320) 2026-09-10 14:50:48 +02:00
amneziawgnet feat(amneziawg): add AmneziaWG as an outbound protocol (#6320) 2026-09-10 14:50:48 +02:00
config v3.7.0 2026-08-24 15:07:15 +02:00
crypto/nodetoken feat(pia): add PIA login-and-add WireGuard outbounds (#6272) 2026-08-22 23:11:06 +02:00
database fix(mtproto): use hosts for public share links (#6369) 2026-09-08 15:36:57 +02:00
eventbus chore: refresh dependencies, fix Linux tool tasks, modernize Go idioms 2026-07-25 16:08:09 +02:00
logger fix(inbounds): apply runtime changes after the DB commit (#5768) 2026-07-08 22:12:28 +02:00
mtproto fix(mtproto): synchronize child-process lifecycle (#6141) 2026-07-29 20:56:26 +02:00
pia chore(build): bump Go toolchain to 1.27.0 2026-08-23 21:57:03 +02:00
sub feat(sub): add AmneziaWG proxy generation for Clash subscriptions (#6326) 2026-09-10 14:20:18 +02:00
tunnelmonitor style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
util feat(xray): update xray-core to v26.9.9 and follow the udpHop move 2026-09-09 01:53:00 +02:00
web feat(amneziawg): add AmneziaWG as an outbound protocol (#6320) 2026-09-10 14:50:48 +02:00
xray docs(api): align OpenAPI with runtime contracts (#6409) 2026-09-04 15:23:41 +02:00