JSPM

hapi-forwarded-for

2.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3913
  • Score
    100M100P100Q129558F
  • License MIT

hapi 19 plugin: sets request.info.remoteAddress from x-forwarded-for header

Package Exports

  • hapi-forwarded-for

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hapi-forwarded-for) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status

hapi-forwarded-for

hapi.js v19+ plugin: sets request.info.remoteAddress from x-forwarded-for header when proxies are in front of hapi

Installation

npm install --save hapi-forwarded-for

or

yarn add hapi-forwarded-for

Usage

let server = new Hapi.Server();
await server.register({ plugin: require('hapi-forwarded-for') });

server.route({
    method: 'GET',
    path: '/',
    handler: (request, h) => {
        return request.info.remoteAddress;
    }
});

License

MIT