Skip to content

Instantly share code, notes, and snippets.

@matylla
Created May 23, 2011 19:59
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save matylla/987455 to your computer and use it in GitHub Desktop.
node js get client ip
function getClientAddress(req) {
return req.headers['x-forwarded-for'] || req.connection.remoteAddress;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment