Answers for "emit value from node server"

0

emit value from node server

let msg = {message: 'Actual Message', sender: 'Name of sender'}
io.on('connection', socket => {
  socket.on('chat message', msg => {
    io.emit('chat message', msg);
  });
});
Posted by: Guest on June-02-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language