Im using the following code in index.js
io.on(\'connection\', function(socket){ console.log(\'a user connected\'); console.log(socket.id); });
To get client side socket id for Latest socket.io 2.0 use the code below
let socket = io(); //on connect Event socket.on('connect', () => { //get the id from socket console.log(socket.id); });