toxy rule to filter by IP
v6 addresses, supporting CIDR, subnets and custom/public/reserved IP ranges.
|Poison Phase||incoming / outgoing|
npm install toxy-ip [--save]
const toxy =const ip =const proxy =proxyall'/'proxyall'/download'proxyall'/intranet'proxyall'/custom-range'proxyall'/private'proxyall'/local'proxy
const ip =
function (req, res, next)
string- Matches an IP address using a equality comparison. Supports CIDR expressions for ranges.
string|array- List of CIDR addresses to filter. Array can contain multiple CIDR addresses.
array- Pair of IP range to match.
boolean- Matches if the client address is a reserved private range. Default
boolean- Matches if the client address is a non-reserved IP range. Default
boolean- Matches if the client address is a loopback valid address. Default
ip.evalRange(range, ip) =>
Evaluates if the IP is inside the given range.
range must be an
array with two items representing the IP range.
ip.evalNetwork(networks, ip) =>
Evaluates if the IP is inside a
ip.evalType(opts, ip) =>
Evaluates if the IP is public, private or loopback IP address.
node-ip module API.
MIT - Tomas Aparicio