ryanbillingsley / express-ipfilter

A light-weight IP address based connection filtering system
MIT License
109 stars 44 forks source link

Update IP block list #58

Closed mayeaux closed 6 years ago

mayeaux commented 6 years ago

I'd like to update the IP block list on the fly, is there a good way to do this while still using it as an express middleware? Thanks

Chalarangelo commented 6 years ago

I would also like to know if this is possible somehow.

ludetc commented 6 years ago

It's in the documentation:

Using a function to get Ips:

var ips = function() { return ['127.0.0.1']; };

// Create the server app.use(ipfilter(ips, {mode: 'allow'}));

module.exports = app;

Works great.