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: https://github.com/nodejs/node/pull/24199 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
6727f1c787
commit
3833d69936
@ -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.
|
||||
|
@ -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'
|
||||
};
|
||||
@ -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'
|
||||
};
|
||||
@ -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'
|
||||
@ -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.
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user