Skip to content

Commit 6ab46b5

Browse files
sam-githubBridgeAR
authored andcommittedNov 13, 2018
doc: fix some inconsistent use of hostname
host names are DNS names, host addresses are IP addresses, and `host` arguments and options can be either. PR-URL: #24199 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent c8d8e5c commit 6ab46b5

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed
 

‎doc/api/async_hooks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ of propagating what resource is responsible for the new resource's existence.
296296
been initialized. This can contain useful information that can vary based on
297297
the value of `type`. For instance, for the `GETADDRINFOREQWRAP` resource type,
298298
`resource` provides the hostname used when looking up the IP address for the
299-
hostname in `net.Server.listen()`. The API for accessing this information is
299+
host in `net.Server.listen()`. The API for accessing this information is
300300
currently not considered public, but using the Embedder API, users can provide
301301
and document their own resource objects. For example, such a resource object
302302
could contain the SQL query being executed.

‎doc/api/http.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -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.
415415
const http = require('http');
416416

417417
const 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.

‎doc/api/tls.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -811,14 +811,15 @@ decrease overall server throughput.
811811
added: v0.8.4
812812
-->
813813

814-
* `hostname` {string} The hostname to verify the certificate against
814+
* `hostname` {string} The host name or IP address to verify the certificate
815+
against.
815816
* `cert` {Object} An object representing the peer's certificate. The returned
816817
object has some properties corresponding to the fields of the certificate.
817818
* Returns: {Error|undefined}
818819

819820
Verifies the certificate `cert` is issued to `hostname`.
820821

821-
Returns {Error} object, populating it with the reason, host, and cert on
822+
Returns {Error} object, populating it with `reason`, `host`, and `cert` on
822823
failure. On success, returns {undefined}.
823824

824825
This function can be overwritten by providing alternative function as part of

0 commit comments

Comments
 (0)