elad / node-cluster-socket.io

Writeup on how to make node.js cluster and socket.io play nice
421 stars 63 forks source link

Issue with IPV6 addresses preceding IPV4 on Linux #16

Open zpappa opened 8 years ago

zpappa commented 8 years ago

Not sure if this affects other systems but I noticed an issue when trying this out on Fedora 23.

connection.remoteAddress from net.createServer includes what appears to be an IPV6 address preceding the IPV4 address. Example: ::ffff:127.0.0.1

This can be remedied by simply using a better conditional inside worker_index

if (!isNaN(ip[i])) { s += ip[i]; } I have the edit for the readme.md available in a fork.