[GH-ISSUE #4103] Allow TCP and UDP inbounds to share the same port #2783

Closed
opened 2026-10-31 20:27:55 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @Eng1neerX1 on GitHub (Apr 25, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4103

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

  • This feature report is written entirely in English.
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 - [x] This feature report is written entirely in English.
bsakaguchi 2026-10-31 20:27:55 +07:00
Author
Owner

@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.

<!-- gh-comment-id:4319865491 --> @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.
Author
Owner

@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).

<!-- gh-comment-id:4359281365 --> @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).
Author
Owner

@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

<!-- gh-comment-id:4369316424 --> @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
Author
Owner

@MHSanaei commented on GitHub (May 6, 2026):

@pwnnex same
kk

<!-- gh-comment-id:4385085246 --> @MHSanaei commented on GitHub (May 6, 2026): @pwnnex same kk
Author
Owner

@pwnnex commented on GitHub (May 6, 2026):

i will fix it today

<!-- gh-comment-id:4385385924 --> @pwnnex commented on GitHub (May 6, 2026): i will fix it today
Author
Owner

@Eng1neerX1 commented on GitHub (May 6, 2026):

@pwnnex同 kk

我今天会把它修好。

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

<!-- gh-comment-id:4387271964 --> @Eng1neerX1 commented on GitHub (May 6, 2026): > [@pwnnex](https://github.com/pwnnex)同 kk > 我今天会把它修好。 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
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#2783
No description provided.