mirror of https://github.com/cbeuw/Cloak
Acceptor function
This commit is contained in:
parent
ae3f97df1e
commit
5cbc24817d
|
|
@ -166,7 +166,12 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if authInfo.Unordered {
|
if authInfo.Unordered {
|
||||||
client.RouteUDP(net.ListenPacket, localConfig, seshMaker)
|
acceptor := func() (*net.UDPConn, error) {
|
||||||
|
udpAddr, _ := net.ResolveUDPAddr("udp", localConfig.LocalAddr)
|
||||||
|
return net.ListenUDP("udp", udpAddr)
|
||||||
|
}
|
||||||
|
|
||||||
|
client.RouteUDP(acceptor, localConfig.Timeout, seshMaker)
|
||||||
} else {
|
} else {
|
||||||
listener, err := net.Listen("tcp", localConfig.LocalAddr)
|
listener, err := net.Listen("tcp", localConfig.LocalAddr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue