Tunnel inbound: Fix panic when listening on UDS for Xray's internal services (e.g. API) (#6062)

And API supports listening on UNIX domain socket directly

Completes https://github.com/XTLS/Xray-core/pull/5693
This commit is contained in:
Kosta
2026-05-03 00:56:47 +04:00
committed by GitHub
parent 958eb9ea8f
commit e61eeae258
2 changed files with 20 additions and 5 deletions

View File

@@ -95,7 +95,7 @@ func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn st
}
}
}
if dest.Port == 0 {
if dest.Port == 0 && port != "" {
dest.Port = net.Port(common.Must2(strconv.Atoi(port)))
}
if d.portMap != nil && d.portMap[port] != "" {