get client ip of the request in net library nodejs
问题 I am using sticky session in nodejs which is behind nginx. Sticky session does the load balancing by checking the remoteAddress of the connection. Now the problem is it always take ip of nginx server server = net.createServer({ pauseOnConnect: true },function(c) { // Get int31 hash of ip var worker, ipHash = hash((c.remoteAddress || '').split(/\./g), seed); // Pass connection to worker worker = workers[ipHash % workers.length]; worker.send('sticky-session:connection', c); }); Can we get the