hapi-forwarded-for

2.0.1 • Public • Published

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

/hapi-forwarded-for/

    Package Sidebar

    Install

    npm i hapi-forwarded-for

    Weekly Downloads

    187

    Version

    2.0.1

    License

    MIT

    Unpacked Size

    53.5 kB

    Total Files

    8

    Last publish

    Collaborators

    • rajivm