mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6302] [Feature]: Add AmneziaWG support to outbounds #4278
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#4278
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 @Bushroott on GitHub (Aug 24, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6302
Is your feature request related to a problem?
For hardened cascading tunnels from panel to panel...
Describe the solution you'd like
Actually, the subject. Add this option in the outbound settings.
Alternatives you've considered
No response
Concrete use case
No response
Mockups, screenshots, or examples
No response
Which parts of the panel would this affect?
Other
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Aug 24, 2026):
This is a valid gap, and it is a bigger one than it looks: AmneziaWG in 3x-ui is inbound-only today, and it cannot be added to outbounds by hanging the obfuscation fields off the existing WireGuard outbound — inbound AmneziaWG and outbounds run on two different engines.
Why the WireGuard outbound can't just grow the AWG fields
Outbound JSON is handed to Xray-core verbatim —
internal/xray/config.go:16:so an outbound can only do what an Xray-core proxy implements. Extra
jc/s1/h1keys in the WireGuard outbound settings would be inert, not obfuscation. The settings that outbound actually accepts are exactly these, infrontend/src/schemas/forms/outbound-form.ts:102-111:and the outbound protocol list (
frontend/src/schemas/primitives/outbound-protocol.ts:1-14) has twelve entries —freedom, blackhole, dns, vmess, vless, trojan, shadowsocks, wireguard, hysteria, socks, http, loopback— with no AmneziaWG among them.What AmneziaWG is in this panel
It is deliberately not an Xray protocol. It runs embedded in the panel process,
github.com/amnezia-vpn/amneziawg-go/v3(go.mod:6) over a gVisor userspace netstack. From the package doc atinternal/amneziawg/instance.go:1-10:and the only entry point into that subsystem is a server one —
internal/amneziawg/instance.go:27,func InstanceFromInbound(ib *model.Inbound) (Instance, bool), which returnsfalseunlessib.Protocol == model.AmneziaWGon a stored inbound row. It is reconciled byinternal/web/job/amneziawg_job.goon a 10-second cron (docs/architecture.md:376), and each peer's decapsulated traffic is relayed into a loopback Xray SOCKS5 inbound (internal/amneziawgnet/relay.go,internal/amneziawgnet/socks_config.go).An AmneziaWG outbound is therefore the mirror image of all of that, and none of it exists yet: an amneziawg-go device in client mode dialing a remote endpoint, an egress path from Xray into that device (the reverse of the current inbound relay), its own reconcile loop, plus the outbound form/schema/adapter work. That is a maintainer-scope architecture decision rather than a small patch, so I'm not going to guess at the shape it should take.
Not a duplicate
Every earlier AmneziaWG request — #2459, #3017, #3330, #4849, #5090, #5113, #5237, #5300, #5818 — asked for inbound/server support. That shipped in
effcccce"feat(amneziawg): add native AmneziaWG protocol support (#6105)", first released in v3.7.0. Yours is the outbound counterpart and has not been filed before, so I'm leaving this open on its own.What you can do today for a hardened panel-to-panel hop
frontend/src/pages/xray/outbounds/OutboundFormModal.tsx:530), as is Hysteria2. This needs no host-level changes and is the supported path.streamSettings.sockopt.interfaceas Interface (frontend/src/pages/xray/outbounds/transport/sockopt.tsx:104-109, schema atfrontend/src/schemas/protocols/stream/sockopt.ts:72) andsockopt.markas Mark (fwmark) (same file, lines 98-103) for a policy route. The panel would not manage that tunnel's lifecycle, and I cannot run anything here — treat this as a pointer to the existing fields, not a verified recipe.Verdict: Feature request
This reply was generated automatically; a maintainer may follow up.