@@ -472,14 +472,15 @@ function initAsServerClient (req, socket, head, options) {
472
472
* @param {String } address The URL to which to connect
473
473
* @param {String[] } protocols The list of subprotocols
474
474
* @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
476
476
* @param {(Boolean|Object) } options.perMessageDeflate Enable/disable permessage-deflate
477
477
* @param {String } options.localAddress Local interface to bind for network connections
478
478
* @param {Number } options.protocolVersion Value of the `Sec-WebSocket-Version` header
479
479
* @param {Object } options.headers An object containing request headers
480
480
* @param {String } options.origin Value of the `Origin` or `Sec-WebSocket-Origin` header
481
481
* @param {http.Agent } options.agent Use the specified Agent
482
482
* @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).
483
484
* @param {Function } options.checkServerIdentity A function to validate the server hostname
484
485
* @param {Boolean } options.rejectUnauthorized Verify or not the server certificate
485
486
* @param {String } options.passphrase The passphrase for the private key or pfx
@@ -500,6 +501,7 @@ function initAsClient (address, protocols, options) {
500
501
origin : null ,
501
502
agent : null ,
502
503
host : null ,
504
+ family : null ,
503
505
504
506
//
505
507
// SSL options.
@@ -572,6 +574,7 @@ function initAsClient (address, protocols, options) {
572
574
}
573
575
}
574
576
if ( options . host ) requestOptions . headers . Host = options . host ;
577
+ if ( options . family ) requestOptions . family = options . family ;
575
578
576
579
if ( options . localAddress ) requestOptions . localAddress = options . localAddress ;
577
580
if ( isUnixSocket ) requestOptions . socketPath = serverUrl . pathname ;
0 commit comments