diff options
author | Ouyang Yadong <oyydoibh@gmail.com> | 2018-10-21 15:59:38 +0800 |
---|---|---|
committer | Ouyang Yadong <oyydoibh@gmail.com> | 2018-11-22 21:45:08 +0800 |
commit | 33a25b29a4d654f5c2a5c74725862bccb2fcccfb (patch) | |
tree | a963b15bcba72cabfb317cbb00e47ff33753fbd9 /doc/api/net.md | |
parent | 91748dd89c652939d52f38b94afe9eae4eb8fd5d (diff) | |
download | android-node-v8-33a25b29a4d654f5c2a5c74725862bccb2fcccfb.tar.gz android-node-v8-33a25b29a4d654f5c2a5c74725862bccb2fcccfb.tar.bz2 android-node-v8-33a25b29a4d654f5c2a5c74725862bccb2fcccfb.zip |
net,dgram: add ipv6Only option for net and dgram
For TCP servers, the dual-stack support is enable by default, i.e.
binding host "::" will also make "0.0.0.0" bound. This commit add
ipv6Only option in `net.Server.listen()` and `dgram.createSocket()`
methods which allows to disable dual-stack support. Support for
cluster module is also provided in this commit.
Fixes: https://github.com/nodejs/node/issues/17664
PR-URL: https://github.com/nodejs/node/pull/23798
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/net.md')
-rw-r--r-- | doc/api/net.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/api/net.md b/doc/api/net.md index b925245e7a..35fb0a6171 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -252,6 +252,10 @@ Listening on a file descriptor is not supported on Windows. #### server.listen(options[, callback]) <!-- YAML added: v0.11.14 +changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/23798 + description: The `ipv6Only` option is supported. --> * `options` {Object} Required. Supports the following properties: @@ -266,6 +270,9 @@ added: v0.11.14 for all users. **Default:** `false` * `writableAll` {boolean} For IPC servers makes the pipe writable for all users. **Default:** `false` + * `ipv6Only` {boolean} For TCP servers, setting `ipv6Only` to `true` will + disable dual-stack support, i.e., binding to host `::` won't make + `0.0.0.0` be bound. **Default:** `false`. * `callback` {Function} Common parameter of [`server.listen()`][] functions. * Returns: {net.Server} |