A docker container of mine exposes a HTTP interface on port 8500, which is mapped to host port 8500. It is not IPv6 enabled. This still means, I should be able to access it at localhost:8500. IPv6 is preferred, so I end up with a request to [::1]:8500. This one gets stuck, it never returns.
Reproducing this with curl, this command gets stuck:
curl -g -6 "http://[::1]:8500"
curl's --verbose option reveals nothing, neither does --ascii-trace. At the same time, a request to IPv4's localhost succeeds:
giving me the expected HTML. If I run an IPv4 HTTP server on loopback, using
python -m SimpleHTTPServer 4001
then I get lots of HTML for IPv4's localhost
and a proper connection failure for IPv6:
curl -g -6 "http://[::1]:4001" curl: (7) Failed to connect to ::1 port 4001: Connection refused
Things to note: Docker 1.7.1. IPv6 is not enabled for the container, hence there are no IPv6 iptable rules. (ip6tables -v -L gives nothing)
My question is: Why does the request get stuck, and doing what?