IPv6/IPv4 and 'Happy Eyeballs'
There have been some accumulating issues at Stack's repository that appear to be IPv6-related for Linux, macOS and Windows users.
Somebody who knows much more about this area than me has observed that, basically, the lower level is doing a lookup, getting an IPv6 address, and trying to connect to it despite IPv6 not being configured either locally or on the router; or the reverse (which might happen in some situations), where the lookup gets an IPv4 address and tries to connect to it over an IPv6-only connection.
For its part, the curl project (held up as an exemplar) explains:
How libcurl connects When libcurl is about to do an Internet transfer, it first resolves the host name to get a number of IP addresses for the host. A hostname needs to have at least one address for libcurl to be able to connect to it.
A hostname can have both IPv4 addresses and IPv6 addresses and they can have a set of both.
If the host only returned addresses of a single IP family, libcurl iterates over each address and tries to connect. If the connect attempt fails for an IP, libcurl continues to try the next entry until the entire list is exhausted. ...
Happy Eyeballs When it has received both IPv4 and IPv6 addresses for a host, libcurl first tries to connect to an IPv6 address and after a short delay it tries connecting to the first IPv4 address - at the same time and in parallel. Once one of the attempts succeeds, the others are discarded. This method of attempting to connect using both families at the same time is called Happy Eyeballs and is the widely accepted best practice for Internet clients. ...
For its part, ChatGPT offers up (rightly or wrongly) that 'performing a DNS resolution (which returns both IPv4 and IPv6 addresses) and then attempting connections sequentially in the order returned can result in bad user experience if, say, IPv6 is preferred but broken'.
Does the http-client family of packages do anything similar to 'Happy Eyeballs'? If not, should they or could they?
Does the http-client family of packages do anything similar to 'Happy Eyeballs'? If not, should they or could they?
@mpilgrem You might want to check this
Though crypton-connection seems to be trying connections one by one. So if you are using http-client-tls and trying to establish a secure connection, you might get stuck on the first IPv6 connection if the server doesn't respond at all.