net: Setting LocalAddr to v4 address in net.Dialer not effective if v6 available #14672
Labels
Comments
I quickly tried wrapping the Dial function as described at https://groups.google.com/d/msg/golang-nuts/_VgvTySj25o/-TtM2jYR-0EJ into a Function that sets "tcp4" forcibly but it still has no effect on the outcome.
|
I discovered this may be related to the used http client since when constructing from a http.Client v4 is used. |
Okay, I consider this issue as closed and open up another one for the part of assigning multiple LocalAddrs for DualStack. This version of pester fixes it: sethgrid/pester#6 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
go version
)?go version go1.5.3 linux/amd64
go env
)?I ran the following code: http://play.golang.org/p/sujhjFG8W2
and did a tcpdump in parallel looking for packages containing my local ipv4 that should be used for connecting:
I wish that
I believe that somewhere in the source of the net/http library a hardcoded "tcp" automatically chooses IPv6 for connecting though it definitely shouldn't...
The text was updated successfully, but these errors were encountered: