mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #4103] Allow TCP and UDP inbounds to share the same port #2783
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#2783
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 @Eng1neerX1 on GitHub (Apr 25, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4103
Is your feature request related to a problem?
The current inbound port conflict validation appears to treat a port number as globally occupied.
This prevents a valid configuration such as:
VLESS Reality -> TCP 443
Hysteria2 -> UDP 443
TCP and UDP have separate socket namespaces on Linux, so 0.0.0.0:443/tcp and 0.0.0.0:443/udp should not conflict.
This setup is useful for running Reality on TCP 443 and Hysteria2 on UDP 443 at the same time.
Describe the solution you'd like
The port conflict validation should include the transport protocol/network, not only the numeric port.
The conflict check should be based on:
listen address + port + transport protocol
Allow:
0.0.0.0:443/tcp -> VLESS Reality
0.0.0.0:443/udp -> Hysteria2
Reject:
0.0.0.0:443/tcp -> inbound A
0.0.0.0:443/tcp -> inbound B
Reject:
0.0.0.0:443/udp -> inbound A
0.0.0.0:443/udp -> inbound B
Describe alternatives you've considered
No response
Checklist
@Eng1neerX1 commented on GitHub (Apr 25, 2026):
This has already been implemented in S-UI, which correctly distinguishes TCP and UDP namespaces for port conflict validation.
@hobbes3 commented on GitHub (May 1, 2026):
I also look for this feature since I think it's a good strategy to split tunnel all UDP to port 443 using Hysteria and everything else for VLESS/TCP on port 443 to get the best of both worlds. Also, it looks less suspicious to a firewall for UDP to use port 443 (DoH).
@nebulosa2007 commented on GitHub (May 4, 2026):
The same goes for WireGuard, doesn't it? For now, Hysteria and WG only use UDP ports. I don't think the port check takes into account whether it's TCP or UDP
@MHSanaei commented on GitHub (May 6, 2026):
@pwnnex same
kk
@pwnnex commented on GitHub (May 6, 2026):
i will fix it today
@Eng1neerX1 commented on GitHub (May 6, 2026):
Thank you for the quick fix and hard work
This feature is really useful for running Reality on TCP 443 together with Hysteria2 on UDP 443
Hope the new version can be released soon