Bind server to IPv6 as well as IPv4
Do you want to request a feature or report a bug?
Mostly a feature, but sort of a bug. The server currently only binds to IPv4, so it's hard to run in IPv6 environments without something like socat. In let addr = SocketAddrV4::new(Ipv4Addr::new(0, 0, 0, 0), port);
What is the current behavior? The server binds to IPv4 only.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. N/A
What is the expected behavior? It should bind to IPv6 as well.
Thanks @sudhirj . I noticed a few more places where we bind explicitly for IPv4. Fix seems to be simple (I guess by either binding to both as you suggested, or bind to IPv6 which should have a fallback to IPv4).
@azf20 what do you think?
I think that sounds like a reasonable quick fix - binding to IPv6 seems cleanest if it does indeed have the fallback.. @lutter any thoughts on why this wouldn't work?
I haven't looked at it in detail but supporting IPv6 in addition to IPv4 makes absolute sense and we should support it.
@lutter I checked and it seems like binding to IPv6 only might be an issue for Linux environments, which needs some extra env configuration (IPV6_V6ONLY) for making both available.
I guess we just need to bind to both.
We have an internal use case for IPv6 on our nodes, where we need the HTTP servers to also bind to IPv6.