Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

express-public-ip

1.0.1 • Public • Published

express-public-ip Build Status

Filter private addresses from req.ips

Install

$ npm install --save express express-public-ip

Usage

var app = require('express')();
var expressPublicIp = require('express-public-ip');
 
app.enable('trust proxy');
 
app.use(expressPublicIp());
 
app.get('/', function (req, res) {
    res.send(req.ip);
});

API

expressPublicIp()

Returns express-public-ip middleware function.

License

MIT © Vsevolod Strukchinsky

install

npm i express-public-ip

Downloadsweekly downloads

119

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability