mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-01-06 01:05:35 -05:00
fix mux test
This commit is contained in:
@@ -30,6 +30,18 @@ func pickPort() v2net.Port {
|
||||
return v2net.Port(addr.Port)
|
||||
}
|
||||
|
||||
func pickUDPPort() v2net.Port {
|
||||
conn, err := net.ListenUDP("udp4", &net.UDPAddr{
|
||||
IP: v2net.LocalHostIP.IP(),
|
||||
Port: 0,
|
||||
})
|
||||
common.Must(err)
|
||||
defer conn.Close()
|
||||
|
||||
addr := conn.LocalAddr().(*net.UDPAddr)
|
||||
return v2net.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