curl / curl-container

curl images
MIT License
61 stars 12 forks source link

Does not work with IPv6 only pages #62

Closed tmaier closed 2 weeks ago

tmaier commented 1 month ago

I ran into a connectivity issue and was able to understand it with http://dual.tlund.se

When I run the following locally on my computer: (expected behaviour)

$ curl -v -I http://ipv6.tlund.se/
* Host ipv6.tlund.se:80 was resolved.
* IPv6: 2a00:801:f::195
* IPv4: (none)
*   Trying [2a00:801:f::195]:80...
* Connected to ipv6.tlund.se (2a00:801:f::195) port 80
> HEAD / HTTP/1.1
> Host: ipv6.tlund.se
> User-Agent: curl/8.6.0
> Accept: */*
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Date: Tue, 30 Jul 2024 07:31:19 GMT
Date: Tue, 30 Jul 2024 07:31:19 GMT
< Server: Apache
Server: Apache
< Content-Type: text/html; charset=UTF-8
Content-Type: text/html; charset=UTF-8

<
* Connection #0 to host ipv6.tlund.se left intact

When I run it with curlimages/curl:latest:

$ docker container run --rm -it curlimages/curl:latest -v -I http://ipv6.tlund.se/
* Host ipv6.tlund.se:80 was resolved.
* IPv6: 2a00:801:f::195
* IPv4: (none)
*   Trying [2a00:801:f::195]:80...
* Immediate connect fail for 2a00:801:f::195: Network unreachable
* Failed to connect to ipv6.tlund.se port 80 after 5 ms: Could not connect to server
* closing connection #0
curl: (7) Failed to connect to ipv6.tlund.se port 80 after 5 ms: Could not connect to server
xquery commented 1 month ago

trying to repro

podman run --rm -it curlimages/curl:8.9.0 -v -I http://ipv6.tlund.se/

tmaier commented 2 weeks ago

Futher digging shows that this should be expected, since Docker does not support IPv6 by default.

See https://docs.docker.com/engine/daemon/ipv6/ and https://docs.podman.io/en/v4.4/markdown/podman-network-create.1.html#ipv6

xquery commented 2 weeks ago

thx for digging in - closing this for now