0

I'm working to send message to all room users using nodejs and webrtc.

This is my code:

Client Side

connection.socket.on('get mesg',function(data){
    alert(data);
});

mySocket.emit('get mesg', {
    rid:connection.sessionid,
    mesg : "I m here"
});

Server Side

socket.on('get mesg', function (data) {
    socket.broadcast.to(data.rid).emit('get mesg', 'this is the message'); 
});

I want to send message on base of room id, but this is not working.

Muhammad Awais
  • 156
  • 1
  • 6

0 Answers0