// This creates our socket using the instance of the server
const io = socketIO(server)
// This is what the socket.io syntax is like, we will work this later
io.on('connection', socket => {
console.log('User connected')
socket.on('disconnect', () => {
console.log('user disconnected')
})
})
var chat = io
.of('/chat')
.on('connection', function (socket) {
console.log("200")
socket.emit('a message', {
that: 'only'
, '/chat': 'will get'
});
chat.emit('a message', {
everyone: 'in'
, '/chat': 'will get'
});
});
var news = io
.of('/news')
.on('connection', function (socket) {
socket.emit('item', { news: 'item' });
});
server.listen(port, () => console.log(`Listening on port ${port}`))
<textarea>
<label contenteditable="true"></label>.