mirror of
https://github.com/go-gost/x.git
synced 2026-10-20 17:30:35 +00:00
Add udp.bindRange.min/max (udp.minPort/maxPort) metadata to constrain the client-facing UDP relay socket to a fixed port set, so NAT routers can forward a small range to the SOCKS server. listenPacketInRange scans ports from a random offset within [lo, hi] and retries on EADDRINUSE; with no range configured, the OS chooses (port 0) as before. RFC 1928 leaves relay-port selection to the server, so BND.PORT reports the actually-bound port.