Skip to content

Instantly share code, notes, and snippets.

@blubbll
Created September 1, 2019 17:27
Show Gist options
  • Save blubbll/05a3e9f9c54af1a45ccd451abf1c6588 to your computer and use it in GitHub Desktop.
Save blubbll/05a3e9f9c54af1a45ccd451abf1c6588 to your computer and use it in GitHub Desktop.
nodejs get user ip
app.set('trust proxy', true)
app.get('/ip', (req, res) => {
console.log(req.ip);
res.send(req.ip);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment