curl and IPv6
A couple of days ago I watched a video on YouTube where, during a demo, the creator tried to download a file via wget. It didn’t work. When he tried curl, it worked (That was only a very tiny part of the video).
So why does curl work and wget not? My guess: broken IPv6 on the host. Happy-Eyeballs (HE) is defined in RFC8305 and is used to workaround broken IPv6 connections. It only works for HTTP(S). Basically if a target is dual-stacked a client supporting HE makes two connections to the target and then uses the better (as in working or faster) connection. So if IPv6 on your host is broken you won’t notice.
So if you want to use curl for IPv6 troubleshooting, always invoke curl with the -6 option.
curl -6 example.com
Update:
Over on mastodon it was pointed out to me that this may not work on Macs.
CC BY 4.0