cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl and dual stack mode IPv4 and IPv6

From: Kamil Dudka <kdudka_at_redhat.com>
Date: Tue, 14 Jul 2015 22:15:37 +0200

On Monday, July 13, 2015 11:54:30 Hector Chan wrote:
> Hi,
>
> How does curl work with a domain with dual stack IPv4 and IPv6? Without
> messing with the -4 and -6 options, which address would curl pick ? Does
> curl pick the first address or IPv6 over IPv4, etc ?
>
> Thanks,
> Hector

Assuming you have a new enough version of libcurl, it implements RFC 6555
(Happy Eyeballs). If the first address family (the one appearing first on the
list of addresses returned by your name resolver) does not connect in 200 ms,
it tries to connect the address of the other family in parallel. The fist
address that successfully connects is then used for the transfer.

Kamil
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-07-14