briandela / therealyou

hapi.js plugin for setting the request.info.remoteAddress and request.info.remotePort based on the X-Forwarded-For and X-Forwarded-Port headers
MIT License
7 stars 4 forks source link

Update to support newer Hapi.js versions #10

Open heshanlk opened 4 years ago

heshanlk commented 4 years ago

Hapi newer versions don't support this and it needs to be info._remoteAddress etc.

remoteAddress is just a getter function and in order to change the value you must change the property directly using _remoteAddress.

Just note that request.info is a read-only property so maybe they don't want it to be different than what they have.

https://hapi.dev/api/?v=19.1.0#-requestinfo

AntoineAA commented 3 years ago

Thank you @heshanlk It works with hapi 20.1.3 (by using your forked version)