net: add autoSelectFamily option
This PR loosely implements section 5 of RFC 8305 (Happy Eyeballs algorithm).
A new option autoSelectFamily
is added to net.connect
.
When set to a positive number (or true
), the lookup phase will keep all records by setting all=true
.
A connection attempt will be tried to all AAAA and A records (alternating families), in sequence, giving each connection autoSelectFamily
milliseconds to be established.
Errors are raised only if no connection succeeded.
Fixes #41625 (closed).