Config: Fix some issues (#6640)

https://github.com/XTLS/Xray-core/pull/6640#issuecomment-5420106315

Fixes https://github.com/XTLS/Xray-core/issues/6636
Fixes https://github.com/XTLS/Xray-core/issues/6600
...
This commit is contained in:
风扇滑翔翼
2026-08-27 20:03:59 +08:00
committed by Fangliding
parent aa3d6589da
commit 65458e919f
6 changed files with 19 additions and 12 deletions
-3
View File
@@ -42,9 +42,6 @@ func ListenTCP(ctx context.Context, address net.Address, port net.Port, streamSe
var listener net.Listener
var err error
if port == net.Port(0) { // unix
if !address.Family().IsDomain() {
return nil, errors.New("invalid unix listen: ", address).AtError()
}
listener, err = internet.ListenSystem(ctx, &net.UnixAddr{
Name: address.Domain(),
Net: "unix",
+3
View File
@@ -65,6 +65,9 @@ func ListenTCP(ctx context.Context, address net.Address, port net.Port, settings
if address.Family().IsDomain() {
return nil, errors.New("domain address is not allowed for listening: ", address.Domain())
}
if port == 0 {
return nil, errors.New("port 0 is not allowed for listening on TCP")
}
protocol := settings.ProtocolName
listenFunc := transportListenerCache[protocol]