Question

Running NodeJs I can see a sort of client ID:

debug - emitting heartbeat for client hg5ZurBEi8R3Ehf5kuBJ
debug - websocket writing 2::
debug - set heartbeat timeout for client hg5ZurBEi8R3Ehf5kuBJ
debug - got heartbeat packet
debug - cleared heartbeat timeout for client hg5ZurBEi8R3Ehf5kuBJ
debug - set heartbeat interval for client hg5ZurBEi8R3Ehf5kuBJ

I am using socket.io. There is a way to get "hg5ZurBEi8R3Ehf5kuBJ"? A sort of app.session_id.

Was it helpful?

Solution

If you want to get it on server:

var io = require('socket.io').listen(80);

io.sockets.on('connection', function (socket) {
    console.log(socket.id); //client ID
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top