Neoclassical Programming Multitude

npm

npm’s 2019 JavaScript ecosystem survey analysis is now available! Get your copy here »

httpaddr

1.0.1 • Public • Published

Build Status Coverage Status Version License Code style

Motivation

Filter HTTP remote address through a list of CIDR (with proxies white list support)

API


const allow = require('httpaddr');


var server = http.createServer(function(req, res) {
  var allowed = allow(req, ["127.0.0.1/32"]);
  console.log("Allow only from localhost");

  var allowedproxy = allow(req, ["127.0.0.1/32"], ["someproxies/24"]);
  console.log("Allow only from allowedproxy");
});


server.listen(8080);

Notes

CIDR are filtered through the ipaddr.js module

Credits

install

npm i httpaddr

Downloadsweekly downloads

0

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability