1
0
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:
Darien Raymond
2017-05-03 10:53:35 +02:00
parent dc76e36ed7
commit 0210a718f6
2 changed files with 15 additions and 3 deletions

View File

@@ -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 {