xref: /aosp_15_r20/external/curl/docs/cmdline-opts/happy-eyeballs-timeout-ms.md (revision 6236dae45794135f37c4eb022389c904c8b0090d)
1*6236dae4SAndroid Build Coastguard Worker---
2*6236dae4SAndroid Build Coastguard Workerc: Copyright (C) Daniel Stenberg, <[email protected]>, et al.
3*6236dae4SAndroid Build Coastguard WorkerSPDX-License-Identifier: curl
4*6236dae4SAndroid Build Coastguard WorkerLong: happy-eyeballs-timeout-ms
5*6236dae4SAndroid Build Coastguard WorkerArg: <ms>
6*6236dae4SAndroid Build Coastguard WorkerHelp: Time for IPv6 before IPv4
7*6236dae4SAndroid Build Coastguard WorkerAdded: 7.59.0
8*6236dae4SAndroid Build Coastguard WorkerCategory: connection timeout
9*6236dae4SAndroid Build Coastguard WorkerMulti: single
10*6236dae4SAndroid Build Coastguard WorkerSee-also:
11*6236dae4SAndroid Build Coastguard Worker  - max-time
12*6236dae4SAndroid Build Coastguard Worker  - connect-timeout
13*6236dae4SAndroid Build Coastguard WorkerExample:
14*6236dae4SAndroid Build Coastguard Worker  - --happy-eyeballs-timeout-ms 500 $URL
15*6236dae4SAndroid Build Coastguard Worker---
16*6236dae4SAndroid Build Coastguard Worker
17*6236dae4SAndroid Build Coastguard Worker# `--happy-eyeballs-timeout-ms`
18*6236dae4SAndroid Build Coastguard Worker
19*6236dae4SAndroid Build Coastguard WorkerHappy Eyeballs is an algorithm that attempts to connect to both IPv4 and IPv6
20*6236dae4SAndroid Build Coastguard Workeraddresses for dual-stack hosts, giving IPv6 a head-start of the specified
21*6236dae4SAndroid Build Coastguard Workernumber of milliseconds. If the IPv6 address cannot be connected to within that
22*6236dae4SAndroid Build Coastguard Workertime, then a connection attempt is made to the IPv4 address in parallel. The
23*6236dae4SAndroid Build Coastguard Workerfirst connection to be established is the one that is used.
24*6236dae4SAndroid Build Coastguard Worker
25*6236dae4SAndroid Build Coastguard WorkerThe range of suggested useful values is limited. Happy Eyeballs RFC 6555 says
26*6236dae4SAndroid Build Coastguard Worker"It is RECOMMENDED that connection attempts be paced 150-250 ms apart to
27*6236dae4SAndroid Build Coastguard Workerbalance human factors against network load." libcurl currently defaults to
28*6236dae4SAndroid Build Coastguard Worker200 ms. Firefox and Chrome currently default to 300 ms.
29