mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6798] [Question]: how to setup tcp port forwarding to wireguard peer? #4528
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#4528
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 @alexalv76-sudo on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6798
What are you trying to do?
https://github.com/MHSanaei/3x-ui/issues/4366#issue-4444225930
Here you said that this feature is implemented. But i can not setup it. Using 3x-ui pannel on server side and created "tunnel" inbound for listening tcp port. And using wireguard application for windows on peer side. Can not setup 3xui to route this traffic
What have you already tried?
No response
3x-ui version
3.10.0
How did you install 3x-ui?
install.sh script
Operating system
No response
Screenshots or config snippets
No response
Before submitting
@github-actions[bot] commented on GitHub (Oct 12, 2026):
The feature from #4366 is not set up with a Tunnel inbound, and it does not exist for the Xray WireGuard inbound. It is a per-client Forwarded Ports field that only AmneziaWG inbounds have. The panel opens the listener itself, so you don't need a Tunnel/Dokodemo inbound or a routing rule.
How to set it up
27015or80, 443, 8000-8100..conf(or itsvpn://link) and import it into an AmneziaWG-capable client on Windows, such as AmneziaVPN or the AmneziaWG client. The.confcontains AmneziaWG obfuscation keys (Jc,S1,H1, …), and the docs only list the AmneziaWG/AmneziaVPN apps as able to import it. So the plain WireGuard for Windows app is not expected to work here. That last point is my inference from the docs; I didn't test it.server:PORTto<client tunnel IP>:PORTwith no port remapping. It forwards both TCP and UDP.Docs:
docs/content/docs/en/config/amneziawg.mdx, section "Optional: forward ports to a client".Limits worth knowing (from the source)
MaxForwardedPorts = 100).Evidence
frontend/src/pages/clients/ClientFormModal.tsx:739-743only sends the field for AmneziaWG clients:internal/amneziawgnet/portfwd.go:307opens a real host listener on the port:net.JoinHostPort(wildcardBindHost, strconv.Itoa(key.port)). Line 342 then dials the peer's tunnel address on that same port:gonet.DialContextTCP(ctx, gstack, tunnelFullAddress(addr, key.port), ...).internal/amneziawgnet/portfwd.go:42-45gives every forwarded port both a TCP and a UDP socket.internal/amneziawg/portfwd.go:100sets the cap:const MaxForwardedPorts = 100.internal/amneziawgnet/portfwd.go:16-18: forwarded-port bytes "don't appear in Xray's per-email stats/quota counters".Verdict: Not a bug (user configuration). The feature works only on an AmneziaWG inbound, through the client's Forwarded Ports field, not through a Tunnel inbound on a WireGuard setup.
This reply was generated automatically; a maintainer may follow up.