const io = require('socket.io')(); io.emit('an event sent to all connected clients'); // main namespace const chat = io.of('/chat'); chat.emit('an event sent to all connected clients in chat namespace');
namespace 안에 있으면 그 네임스페이스 언급하고 해야함!!
const io = require('socket.io')(); io.emit('an event sent to all connected clients'); // main namespace const chat = io.of('/chat'); chat.emit('an event sent to all connected clients in chat namespace');