Skip to content

(hapi.js 19+ plugin) sets request.info.remoteAddress from x-forwarded-for header

License

Notifications You must be signed in to change notification settings

soxhub/hapi-forwarded-for

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

(hapi.js 19+ plugin) sets request.info.remoteAddress from x-forwarded-for header

Resources

License

Stars

Watchers

Forks

Packages

No packages published