@@ -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'
@@ -1924,14 +1924,14 @@ changes:
1924
1924
* ` host ` {string} A domain name or IP address of the server to issue the
1925
1925
request to. ** Default:** ` 'localhost' ` .
1926
1926
* ` hostname ` {string} Alias for ` host ` . To support [ ` url.parse() ` ] [ ] ,
1927
- ` hostname ` is preferred over ` host ` .
1928
- * ` family ` {number} IP address family to use when resolving ` host ` and
1927
+ ` hostname ` will be used if both ` host ` and ` hostname ` are specified .
1928
+ * ` family ` {number} IP address family to use when resolving ` host ` or
1929
1929
` hostname ` . Valid values are ` 4 ` or ` 6 ` . When unspecified, both IP v4 and
1930
1930
v6 will be used.
1931
1931
* ` port ` {number} Port of remote server. ** Default:** ` 80 ` .
1932
1932
* ` localAddress ` {string} Local interface to bind for network connections.
1933
- * ` socketPath ` {string} Unix Domain Socket (use one of ` host:port ` or
1934
- ` socketPath ` ).
1933
+ * ` socketPath ` {string} Unix Domain Socket (cannot be used if one of ` host `
1934
+ or ` port ` is specified, those specify a TCP Socket ).
1935
1935
* ` method ` {string} A string specifying the HTTP request method. ** Default:**
1936
1936
` 'GET' ` .
1937
1937
* ` path ` {string} Request path. Should include query string if any.
0 commit comments