A light-weight IP address based filtering system, support ipv4 mapped ipv6 address
npm install express-ipfilter-fishexpress-ipfilter: A light-weight IP address based filtering system
=================================================================================
This package provides easy IP based access control. This can be achieved either by blacklisting certain IPs and whitelisting all others, or whitelisting certain IPs and blacklisting all others.

javascript
// Init dependencies
var express = require('express')
, ipfilter = require('express-ipfilter')
, app = express.createServer()
;
// Blacklist the following IPs
// Now this can block "::1" IP , editor: Fish
var ips = ['127.0.0.1'];
// Create the server
app.use(ipfilter(ips));
app.listen(3000);
`
Whitelisting certain IP addresses, while denying all other IPs:
`javascript
// Init dependencies
var express = require('express')
, ipfilter = require('express-ipfilter')
, app = express.createServer()
;
// Whitelist the following IPs
var ips = ['127.0.0.1'];
// Create the server
app.use(ipfilter(ips, {mode: 'allow'}));
app.listen(3000);
`
Using CIDR subnet masks for ranges:
`javascript
var ips = ['127.0.0.1/24'];
// Create the server
app.use(ipfilter(ips, {mode: 'allow'}));
app.listen(3000);
`
Using IP ranges:
`javascript
var ips = [['127.0.0.1','127.0.0.10']];
// Create the server
app.use(ipfilter(ips, {mode: 'allow'}));
app.listen(3000);
``