mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-01-05 16:55:27 -05:00
move port allocation to udp package
This commit is contained in:
@@ -29,18 +29,6 @@ func pickPort() net.Port {
|
||||
return net.Port(addr.Port)
|
||||
}
|
||||
|
||||
func pickUDPPort() net.Port {
|
||||
conn, err := net.ListenUDP("udp4", &net.UDPAddr{
|
||||
IP: net.LocalHostIP.IP(),
|
||||
Port: 0,
|
||||
})
|
||||
common.Must(err)
|
||||
defer conn.Close()
|
||||
|
||||
addr := conn.LocalAddr().(*net.UDPAddr)
|
||||
return net.Port(addr.Port)
|
||||
}
|
||||
|
||||
func xor(b []byte) []byte {
|
||||
r := make([]byte, len(b))
|
||||
for i, v := range b {
|
||||
|
||||
Reference in New Issue
Block a user