@@ -368,7 +368,7 @@ proxy.listen(1337, '127.0.0.1', () => {
368
368
// make a request to a tunneling proxy
369
369
const options = {
370
370
port: 1337 ,
371
- hostname : ' 127.0.0.1' ,
371
+ host : ' 127.0.0.1' ,
372
372
method: ' CONNECT' ,
373
373
path: ' www.google.com:80'
374
374
};
@@ -415,7 +415,7 @@ event is emitted with a callback containing an object with a status code.
415
415
const http = require (' http' );
416
416
417
417
const options = {
418
- hostname : ' 127.0.0.1' ,
418
+ host : ' 127.0.0.1' ,
419
419
port: 8080 ,
420
420
path: ' /length_request'
421
421
};
@@ -502,7 +502,7 @@ srv.listen(1337, '127.0.0.1', () => {
502
502
// make a request
503
503
const options = {
504
504
port: 1337 ,
505
- hostname : ' 127.0.0.1' ,
505
+ host : ' 127.0.0.1' ,
506
506
headers: {
507
507
' Connection' : ' Upgrade' ,
508
508
' Upgrade' : ' websocket'
@@ -1898,14 +1898,14 @@ changes:
1898
1898
* ` host ` {string} A domain name or IP address of the server to issue the
1899
1899
request to. ** Default:** ` 'localhost' ` .
1900
1900
* ` 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
1903
1903
` hostname ` . Valid values are ` 4 ` or ` 6 ` . When unspecified, both IP v4 and
1904
1904
v6 will be used.
1905
1905
* ` port ` {number} Port of remote server. ** Default:** ` 80 ` .
1906
1906
* ` 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 ).
1909
1909
* ` method ` {string} A string specifying the HTTP request method. ** Default:**
1910
1910
` 'GET' ` .
1911
1911
* ` path ` {string} Request path. Should include query string if any.
0 commit comments