Skip to content

Instantly share code, notes, and snippets.

@ovaillancourt
Created November 28, 2011 21:00
Show Gist options
  • Save ovaillancourt/1402035 to your computer and use it in GitHub Desktop.
Save ovaillancourt/1402035 to your computer and use it in GitHub Desktop.
remoteAddress not being set...
if(typeof req.header('x-forwarded-for') !== 'undefined')
{
req.socket.remoteAddress = req.header('x-forwarded-for');
console.log(req.header('x-forwarded-for'));
console.log(req.socket.remoteAddress);
}
-----------------------
outputs:
70.30.241.108
127.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment