Skip to content

Commit

Permalink
doc: fix some inconsistent use of hostname
Browse files Browse the repository at this point in the history
host names are DNS names, host addresses are IP addresses, and `host`
arguments and options can be either.

PR-URL: nodejs#24199
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
sam-github authored and kiyomizumia committed Nov 15, 2018
1 parent 4b5e4a4 commit 780eca9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion doc/api/async_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ of propagating what resource is responsible for the new resource's existence.
been initialized. This can contain useful information that can vary based on
the value of `type`. For instance, for the `GETADDRINFOREQWRAP` resource type,
`resource` provides the hostname used when looking up the IP address for the
hostname in `net.Server.listen()`. The API for accessing this information is
host in `net.Server.listen()`. The API for accessing this information is
currently not considered public, but using the Embedder API, users can provide
and document their own resource objects. For example, such a resource object
could contain the SQL query being executed.
Expand Down
14 changes: 7 additions & 7 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ proxy.listen(1337, '127.0.0.1', () => {
// make a request to a tunneling proxy
const options = {
port: 1337,
hostname: '127.0.0.1',
host: '127.0.0.1',
method: 'CONNECT',
path: 'www.google.com:80'
};
Expand Down Expand Up @@ -415,7 +415,7 @@ event is emitted with a callback containing an object with a status code.
const http = require('http');

const options = {
hostname: '127.0.0.1',
host: '127.0.0.1',
port: 8080,
path: '/length_request'
};
Expand Down Expand Up @@ -502,7 +502,7 @@ srv.listen(1337, '127.0.0.1', () => {
// make a request
const options = {
port: 1337,
hostname: '127.0.0.1',
host: '127.0.0.1',
headers: {
'Connection': 'Upgrade',
'Upgrade': 'websocket'
Expand Down Expand Up @@ -1898,14 +1898,14 @@ changes:
* `host` {string} A domain name or IP address of the server to issue the
request to. **Default:** `'localhost'`.
* `hostname` {string} Alias for `host`. To support [`url.parse()`][],
`hostname` is preferred over `host`.
* `family` {number} IP address family to use when resolving `host` and
`hostname` will be used if both `host` and `hostname` are specified.
* `family` {number} IP address family to use when resolving `host` or
`hostname`. Valid values are `4` or `6`. When unspecified, both IP v4 and
v6 will be used.
* `port` {number} Port of remote server. **Default:** `80`.
* `localAddress` {string} Local interface to bind for network connections.
* `socketPath` {string} Unix Domain Socket (use one of `host:port` or
`socketPath`).
* `socketPath` {string} Unix Domain Socket (cannot be used if one of `host`
or `port` is specified, those specify a TCP Socket).
* `method` {string} A string specifying the HTTP request method. **Default:**
`'GET'`.
* `path` {string} Request path. Should include query string if any.
Expand Down
5 changes: 3 additions & 2 deletions doc/api/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -811,14 +811,15 @@ decrease overall server throughput.
added: v0.8.4
-->

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

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

Returns {Error} object, populating it with the reason, host, and cert on
Returns {Error} object, populating it with `reason`, `host`, and `cert` on
failure. On success, returns {undefined}.

This function can be overwritten by providing alternative function as part of
Expand Down

0 comments on commit 780eca9

Please sign in to comment.