wgengine/netstack: use system dialer to contact servers on localhost

Updates #504

Updates #707

Signed-off-by: Naman Sood <mail@nsood.in>
This commit is contained in:
Naman Sood 2021-03-03 11:17:14 -05:00
parent 7461dded88
commit d01c60dad5
1 changed files with 2 additions and 1 deletions

View File

@ -350,7 +350,8 @@ func (ns *Impl) forwardTCP(client *gonet.TCPConn, wq *waiter.Queue, port uint16)
}
cancel()
}()
server, err := ns.DialContextTCP(ctx, net.JoinHostPort("localhost", strconv.Itoa(int(port))))
var stdDialer net.Dialer
server, err := stdDialer.DialContext(ctx, "tcp", net.JoinHostPort("localhost", strconv.Itoa(int(port))))
if err != nil {
ns.logf("netstack: could not connect to local server on port %v: %v", port, err)
return