fix XTCP error handling (#2273)

This commit is contained in:
iikira 2021-03-03 20:54:46 +08:00 committed by GitHub
parent 78b8bb7bc6
commit 0a2384a283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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