From e79471deb7b5c91f061bf395bbef9816e26b4bf9 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 25 Mar 2021 13:27:03 -0700 Subject: net: allow net.BlockList to use net.SocketAddress objects Signed-off-by: James M Snell PR-URL: https://github.com/nodejs/node/pull/37917 Reviewed-By: Matteo Collina --- doc/api/net.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'doc/api/net.md') diff --git a/doc/api/net.md b/doc/api/net.md index c7f3ba5616..9a4b48317e 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -69,7 +69,7 @@ IP subnets. added: v15.0.0 --> -* `address` {string} An IPv4 or IPv6 address. +* `address` {string|net.SocketAddress} An IPv4 or IPv6 address. * `type` {string} Either `'ipv4'` or `'ipv6'`. **Default:** `'ipv4'`. Adds a rule to block the given IP address. @@ -79,8 +79,9 @@ Adds a rule to block the given IP address. added: v15.0.0 --> -* `start` {string} The starting IPv4 or IPv6 address in the range. -* `end` {string} The ending IPv4 or IPv6 address in the range. +* `start` {string|net.SocketAddress} The starting IPv4 or IPv6 address in the + range. +* `end` {string|net.SocketAddress} The ending IPv4 or IPv6 address in the range. * `type` {string} Either `'ipv4'` or `'ipv6'`. **Default:** `'ipv4'`. Adds a rule to block a range of IP addresses from `start` (inclusive) to @@ -91,7 +92,7 @@ Adds a rule to block a range of IP addresses from `start` (inclusive) to added: v15.0.0 --> -* `net` {string} The network IPv4 or IPv6 address. +* `net` {string|net.SocketAddress} The network IPv4 or IPv6 address. * `prefix` {number} The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`. @@ -104,7 +105,7 @@ Adds a rule to block a range of IP addresses specified as a subnet mask. added: v15.0.0 --> -* `address` {string} The IP address to check +* `address` {string|net.SocketAddress} The IP address to check * `type` {string} Either `'ipv4'` or `'ipv6'`. **Default:** `'ipv4'`. * Returns: {boolean} -- cgit v1.2.1