@@ -856,6 +856,9 @@ behavior.
856856<!-- YAML
857857added: v0.1.90
858858changes:
859+ - version: REPLACEME
860+ pr-url: https://github.com/nodejs/node/pull/44731
861+ description: Added the `autoSelectFamily` option.
859862 - version:
860863 - v17.7.0
861864 - v16.15.0
@@ -902,6 +905,20 @@ For TCP connections, available `options` are:
902905 ** Default:** ` false ` .
903906* ` keepAliveInitialDelay ` {number} If set to a positive number, it sets the initial delay before
904907 the first keepalive probe is sent on an idle socket.** Default:** ` 0 ` .
908+ * ` autoSelectFamily ` {boolean}: If set to ` true ` , it enables a family autodetection algorithm
909+ that loosely implements section 5 of [ RFC 8305] [ ] .
910+ The ` all ` option passed to lookup is set to ` true ` and the sockets attempts to connect to all
911+ obtained IPv6 and IPv4 addresses, in sequence, until a connection is established.
912+ The first returned AAAA address is tried first, then the first returned A address and so on.
913+ Each connection attempt is given the amount of time specified by the ` autoSelectFamilyAttemptTimeout `
914+ option before timing out and trying the next address.
915+ Ignored if the ` family ` option is not ` 0 ` or if ` localAddress ` is set.
916+ Connection errors are not emitted if at least one connection succeeds.
917+ ** Default:** ` false ` .
918+ * ` autoSelectFamilyAttemptTimeout ` {number}: The amount of time in milliseconds to wait
919+ for a connection attempt to finish before trying the next address when using the ` autoSelectFamily ` option.
920+ If set to a positive integer less than ` 10 ` , then the value ` 10 ` will be used instead.
921+ ** Default:** ` 250 ` .
905922
906923For [ IPC] [ ] connections, available ` options ` are:
907924
@@ -1630,6 +1647,7 @@ net.isIPv6('fhqwhgads'); // returns false
16301647
16311648[ IPC ] : #ipc-support
16321649[ Identifying paths for IPC connections ] : #identifying-paths-for-ipc-connections
1650+ [ RFC 8305 ] : https://www.rfc-editor.org/rfc/rfc8305.txt
16331651[ Readable Stream ] : stream.md#class-streamreadable
16341652[ `'close'` ] : #event-close
16351653[ `'connect'` ] : #event-connect
0 commit comments