@@ -472,14 +472,15 @@ function initAsServerClient (req, socket, head, options) {
472472 * @param {String } address The URL to which to connect
473473 * @param {String[] } protocols The list of subprotocols
474474 * @param {Object } options Connection options
475- * @param {String } option .protocol Value of the `Sec-WebSocket-Protocol` header
475+ * @param {String } options .protocol Value of the `Sec-WebSocket-Protocol` header
476476 * @param {(Boolean|Object) } options.perMessageDeflate Enable/disable permessage-deflate
477477 * @param {String } options.localAddress Local interface to bind for network connections
478478 * @param {Number } options.protocolVersion Value of the `Sec-WebSocket-Version` header
479479 * @param {Object } options.headers An object containing request headers
480480 * @param {String } options.origin Value of the `Origin` or `Sec-WebSocket-Origin` header
481481 * @param {http.Agent } options.agent Use the specified Agent
482482 * @param {String } options.host Value of the `Host` header
483+ * @param {Number } options.family IP address family to use during hostname lookup (4 or 6).
483484 * @param {Function } options.checkServerIdentity A function to validate the server hostname
484485 * @param {Boolean } options.rejectUnauthorized Verify or not the server certificate
485486 * @param {String } options.passphrase The passphrase for the private key or pfx
@@ -500,6 +501,7 @@ function initAsClient (address, protocols, options) {
500501 origin : null ,
501502 agent : null ,
502503 host : null ,
504+ family : null ,
503505
504506 //
505507 // SSL options.
@@ -572,6 +574,7 @@ function initAsClient (address, protocols, options) {
572574 }
573575 }
574576 if ( options . host ) requestOptions . headers . Host = options . host ;
577+ if ( options . family ) requestOptions . family = options . family ;
575578
576579 if ( options . localAddress ) requestOptions . localAddress = options . localAddress ;
577580 if ( isUnixSocket ) requestOptions . socketPath = serverUrl . pathname ;
0 commit comments