title: How to get IP address in node.js express
body: <p>how we get ip address from node.js I'm try many way but it's doesn't work and return ::ffff:127.0.0.1 please give me some advice</p>
  
  <p>This is my code:</p>
  
  <pre><code>app.put('/update-user-info', function(req, res){
    // it's doesn't work and return ::ffff:127.0.0.1
    var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress ||  req.socket.remoteAddress || req.connection.socket.remoteAddress; 
  });
  </code></pre>