mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6603] [MERGED] fix: allow IPv4 and IPv6 inbounds to share a port #6371
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#6371
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?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6603
Author: @lin-finegold
Created: 9/18/2026
Status: ✅ Merged
Merged: 9/26/2026
Merged by: @MHSanaei
Base:
main← Head:fix/dual-stack-port-conflict📝 Commits (3)
a5a0ff4fix: distinguish IPv4 and IPv6 listen conflicts2ad3816Merge remote-tracking branch 'origin/main' into pr-6603cd49cf5fix(ports): let an IPv4 address share a port only with a v6only wildcard📊 Changes
4 files changed (+121 additions, -11 deletions)
View changed files
📝
internal/web/service/port_conflict.go(+67 -9)📝
internal/web/service/port_conflict_test.go(+27 -1)📝
internal/web/service/xray_bind_conflict.go(+3 -1)📝
internal/web/service/xray_bind_conflict_test.go(+24 -0)📄 Description
Summary
Allow an IPv4 inbound and an IPv6 inbound to use the same TCP/UDP port when their listen addresses belong to different address families.
Problem
The listen conflict guard treated
::and0.0.0.0as one universal wildcard. This rejected valid dual-stack configurations such as::::44310.5.0.200:443The Xray runtime can bind these independently on Linux with IPv6-only sockets, but the panel rejected edits with a false port-conflict error.
Change
Tests
go test ./internal/web/service -run 'TestBindConflicts|TestCheckValidWildcardListenPortConflict' -count=1go build -trimpath -o /tmp/x-ui-fixed .git diff --checkAdded regression cases cover IPv4/IPv6 wildcard coexistence and same-family wildcard conflicts.
Scope
No database schema, inbound configuration, client data, or runtime deployment files are included.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.