Socket
Book a DemoInstallSign in
Socket

ipsentry

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipsentry

Lightweight Connect Middleware access control with ip addresses

0.0.1
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

IPSentry

Build Status

ipsentry is a lightweight piece of Connect Middleware to provide access control based on a ip addresses.

Installation

via npm

npm install ipsentry

Usage

ipsentry expects an array of ip addresses. These are whitelisted for access.

If a client tries to connect from an invalid ip address a 403 response will be returned.

For connect

var connect = require('connect'),
  http = require('http')
  ipsentry = require('ipsentry');

function accessGranted(req, res){
  res.end('ipsentry says yes!');
}
var app = connect()
  .use(ipsentry(['127.0.0.1']))
  .use(accessGranted)
 
http.Server(app).listen(3000);

For express

var express = require('express'),
  ipsentry = require('ipsentry'),
  app = express();

app.use(ipsentry(['127.0.0.1']))

app.get('/', function(req, res){
  res.send('ipsentry says yes!');
});

app.listen(3000);

Keywords

access control

FAQs

Package last updated on 19 Aug 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.