1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-07-26 11:44:22 -04:00

Fix: net.Address type checking (#1629)

Allow zero port for listening port, namely random port.
This commit is contained in:
1ocalhost 2022-04-06 13:42:25 +08:00 committed by GitHub
parent 7bcb3c901b
commit 64a780bba6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,7 @@ 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() {
listener, err = internet.ListenSystem(ctx, &net.UnixAddr{
Name: address.Domain(),
Net: "unix",