JSFiddle - React, Tailwind, and code Playground

by Yang Tyler

JavaScript

//server side code
//namespace if you need
io.of('/yournamespace')
.on('connection', function(websocket){
    console.log('=====================================');
    console.log('New websocket connect to server side!');
    console.log('Current connect id:' + websocket.id);
    console.log('Current connect sockets list:');
    console.log(websocket.namespace.sockets);  // [circular] is the current socket
    
    websocket.on('disconnect', function(){
        console.log('----------------------------------');
        console.log('Websocket:' + websocket.id + 'is close its connection.'); 
    });    
});



//After about 10 seconds you will see the