proxy-ip
v0.1.1
Published
proxy-ip ======== [![License][license-image]][license-url] [![NPM Version][npm-version-image]][npm-url] [![Tag Version][tag-version-image]][github-url] [![Build Status][build-image]][build-url]
Downloads
12
Maintainers
Readme
proxy-ip
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
- 'cloudflare' - https://www.cloudflare.com/ips-v4
- 'any' - 0.0.0.0/0, which is perfect if you have a forced trusted routing layer such as heroku.
IPv6?
Not yet ;)