Websockets tutorial: chatroom

Please help me
I have been working for hours on this:

Server.js - →
wsServer.on(‘connection’,(socket)=>{
console.log(‘New Client connected! :robot:’)
socket.on(‘message’,(data)=>{
console.log(data)
socket.send('Message Received: '+data)
wsServer.clients.forEach(connectedSocket =>{
connectedSocket.send(data.toString())
})
})
})

But when I send the message, it shows - [Object Blob]
I want to show the string, but it’s not working. Please help me to get away from this problem.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.