Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

proxy-ip

terribleplan14ISC0.1.1

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]

proxy, ip, x-forwarded-for, real-ip

readme

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 ;)