proxy-ip

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]

Usage no npm install needed!

<script type="module">
  import proxyIp from 'https://cdn.skypack.dev/proxy-ip';
</script>

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