Im using the following code in index.js
io.on(\'connection\', function(socket){ console.log(\'a user connected\'); console.log(socket.id); });
The following code gives socket.id on client side.