title: Stripping "::ffff:" prefix from request.connection.remoteAddress nodejs
body: <p>I am implementing subscription/response possibility using nodejs (express). When visitor send request, beside other parameters within request (port, time interval etc...) I am going to collect ip in order to be able to send response to that ip from time to time.</p>
  
  <p>I am fetching visitor ip address using folowing: </p>
  
  <pre><code>  var ip = req.headers['x-forwarded-for'] || 
               req.connection.remoteAddress || 
               req.socket.remoteAddress ||
               req.connection.socket.remoteAddress;
  </code></pre>
  
  <p>based on <a href="https://stackoverflow.com/questions/8107856/how-can-i-get-the-users-ip-address-using-node-js">How can I get the user's IP address using Node.js?</a></p>
  
  <p>Point is that after i get ip I have something like this : "::ffff:192.168.1.10" (explained at <a href="https://stackoverflow.com/questions/24896386/request-connection-remoteaddress-now-prefixed-in-ffff-in-node-js">request.connection.remoteAddress Now Prefixed in ::ffff in node.js</a> )</p>
  
  <p>I am wondering, is it "safe" just to strip "::ffff:" prefix in order to get ip address which I will be able to use in order to reply via http response, or I am missing something else over here, and that is not what i should do?</p>