I finally got socket.io to work properly, but I have encountered a strange problem.
I am not sure if this is the best way, but I am using:
io.sockets.cli
I am currently using socket v1.4.29 with typeScript, you can find the number of clients connected by using this
io.sockets.on('connection', function(socket) { var clients = socket.client.conn.emit.length; console.log("clients: " + clients); });