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

/httpaddr/

    Package Sidebar

    Install

    npm i httpaddr

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    4.37 kB

    Total Files

    6

    Last publish

    Collaborators

    • frodon