proxy-ip

0.1.1 • Public • Published

proxy-ip

License NPM Version Tag Version Build Status

Express is pretty awesome, but a binary choice between trusting all proxies or trusting none doesn't cut it with the prevalence of things like cloudflare and heroku, both of which are trusted proxies.

This piece of middleware allows you to define which proxies you trust, and will return the first IP after that.

var app = require('express')();
 
app.use(require('proxy-ip')(['any', 'cloudflare', '192.168.0.0/16']));

Special Values

Due to the prevalence of some services you can define some trusted services by name

IPv6?

Not yet ;)

Package Sidebar

Install

npm i proxy-ip

Weekly Downloads

1

Version

0.1.1

License

ISC

Last publish

Collaborators

  • terribleplan