@@ -368,7 +368,7 @@ proxy.listen(1337, '127.0.0.1', () => {
368368 // make a request to a tunneling proxy
369369 const options = {
370370 port: 1337 ,
371- hostname : ' 127.0.0.1' ,
371+ host : ' 127.0.0.1' ,
372372 method: ' CONNECT' ,
373373 path: ' www.google.com:80'
374374 };
@@ -415,7 +415,7 @@ event is emitted with a callback containing an object with a status code.
415415const http = require (' http' );
416416
417417const options = {
418- hostname : ' 127.0.0.1' ,
418+ host : ' 127.0.0.1' ,
419419 port: 8080 ,
420420 path: ' /length_request'
421421};
@@ -502,7 +502,7 @@ srv.listen(1337, '127.0.0.1', () => {
502502 // make a request
503503 const options = {
504504 port: 1337 ,
505- hostname : ' 127.0.0.1' ,
505+ host : ' 127.0.0.1' ,
506506 headers: {
507507 ' Connection' : ' Upgrade' ,
508508 ' Upgrade' : ' websocket'
@@ -1898,14 +1898,14 @@ changes:
18981898 * ` host ` {string} A domain name or IP address of the server to issue the
18991899 request to. ** Default:** ` 'localhost' ` .
19001900 * ` hostname ` {string} Alias for ` host ` . To support [ ` url.parse() ` ] [ ] ,
1901- ` hostname ` is preferred over ` host ` .
1902- * ` family ` {number} IP address family to use when resolving ` host ` and
1901+ ` hostname ` will be used if both ` host ` and ` hostname ` are specified .
1902+ * ` family ` {number} IP address family to use when resolving ` host ` or
19031903 ` hostname ` . Valid values are ` 4 ` or ` 6 ` . When unspecified, both IP v4 and
19041904 v6 will be used.
19051905 * ` port ` {number} Port of remote server. ** Default:** ` 80 ` .
19061906 * ` localAddress ` {string} Local interface to bind for network connections.
1907- * ` socketPath ` {string} Unix Domain Socket (use one of ` host:port ` or
1908- ` socketPath ` ).
1907+ * ` socketPath ` {string} Unix Domain Socket (cannot be used if one of ` host `
1908+ or ` port ` is specified, those specify a TCP Socket ).
19091909 * ` method ` {string} A string specifying the HTTP request method. ** Default:**
19101910 ` 'GET' ` .
19111911 * ` path ` {string} Request path. Should include query string if any.
0 commit comments