I'm running a simple node.js server that also gots a webinterface using express. Every time a clients goes on the website I'd like to find out who else from this clients network is connected.
I know that I can read out the localIP address of every client using some syntax like this.
var ip = req.headers['x-forwarded-for'] ||
req.connection.remoteAddress ||
req.socket.remoteAddress ||
(req.connection.socket ? req.connection.socket.remoteAddress : null);
... but how can I determine which clients are in the same network? (LAN)
I'm aware that the IP-address is nearly unnecessary/needless because of the currently unkwown Network ID - but how can I determine the networkID on the nodeJS server?
Edit: Is this also possible using socket-io
with node.js?
Any help would be really appreciated. Thanks.