Koa2 middleware to trust specific reverse proxies while distrusting another
npm install koa-trust-proxy

js
$ npm install koa-trust-proxy
`
Examples
`js
const Koa = require('koa');
const trustProxy = require('koa-trust-proxy');
const app = new Koa();
// This line is not needed
//app.proxy = true
// Use middleware instead
// 1st parameter is array or comma-separated list of trusted proxies, default ['127.0.0.1/8', '::1/128']
// 2nd parameter is trusted header, default is X-Forwarded-For
app.use(trustProxy('127.0.0.1, ::1', 'X-Real-IP'));
// You can use CIDRs as well
app.use(trustProxy('192.168.0.1/24, ::1/128', 'X-Real-IP'));
..........
``