fix XTCP error handling (#2273)

pull/2279/head
iikira 4 years ago committed by GitHub
parent 78b8bb7bc6
commit 0a2384a283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -309,6 +309,10 @@ func (pxy *XTCPProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn) {
raddr, _ := net.ResolveUDPAddr("udp",
fmt.Sprintf("%s:%d", pxy.clientCfg.ServerAddr, pxy.serverUDPPort))
clientConn, err := net.DialUDP("udp", nil, raddr)
if err != nil {
xl.Error("dial server udp addr error: %v", err)
return
}
defer clientConn.Close()
err = msg.WriteMsg(clientConn, natHoleClientMsg)

Loading…
Cancel
Save