-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: Listen("tcp", "0.0.0.0:1234") binds to IPv6 addresses #48723
Comments
|
As @AlexanderYastrebov points out, this appears to be working as intended. Closing optimistically. Reply if you disagree or some new information arises. CC @neild |
@mknyszek wrote:
I don't agree this is correct. For example, apache uses this syntax to bind to only IPv4 addresses https://httpd.apache.org/docs/2.4/bind.html#ipv6
I would expect the go std lib to work the same way, not bind to IPv6 addresses when given a very obviously IPv4 address. |
To be clear, because of the Go 1 backwards compatibility guarantee, this cannot be changed at this point without breaking somebody. It appears to be documented, and is otherwise working as per the documentation states. I'm not sure it's possible to move forward here. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Run this program
I get this
Note the second of these is listening on IPv6 even though we explictly gave it an IPv4 bind address.
What did you expect to see?
I expected to see it not binding to IPv6 addresses, something like this
What did you see instead?
I see it binding to IPv4 and IPv6 addresses
This was originally discussed in the rclone forum
The text was updated successfully, but these errors were encountered: