Keyang's Blog
  • HOME
  • CSVTOJSON
  • PSDETCH
  • UML Editor
  • ARCHIVES
Word of Forks
HOME CSVTOJSON PSDETCH UML Editor ARCHIVES

get client ip address in express.js

Mar 30, 2016

According to this, do following to determine the client ipaddress:

1
2
3
4
var ip = (req.headers['x-forwarded-for'] ||
req.connection.remoteAddress ||
req.socket.remoteAddress ||
req.connection.socket.remoteAddress).split(",")[0];
node.js express.js
prev: Docker multi-hosting network quick note next: Quick Note for Unit Tests in Angularjs
©2018 Keyang Xiang