net: Dial("tcp", "addr:port") fails on Windows #31433
Closed
Labels
Comments
@weiyixuan, the example you provided is incomplete: it refers to an Please provide a self-contained code example that illustrates the problem. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
var netAddr net.Addr
netAddr = &net.TCPAddr{}
netAddr.(*net.TCPAddr).IP = net.ParseIP("172.20.32.62")
dialer := net.Dialer{LocalAddr: netAddr}
dialer.Dial(network, address)
What did you expect to see?
dialer.Dial should not cause error
What did you see instead?
(Firewall closed)
dial tcp 192.168.31.193:0->222.73.182.66:80: connectex: The requested address is not valid in its context.
dial tcp 192.168.31.193:0->42.81.100.253:80: connectex: The requested address is not valid in its context.
dial tcp 192.168.31.193:0->112.65.249.214:80: connectex: The requested address is not valid in its context.
The text was updated successfully, but these errors were encountered: