Closed hokage4 closed 1 year ago
Hi, I want to send the broadcast to all clients connected to WebSocket
this code just send to the sender client I need all connected see the message
` var connection = request.accept('echo-protocol', request.origin); console.log((new Date()) + ' Connection accepted.'); connection.on('message', function(message) { if (message.type === 'utf8') {
console.log('Received Message: ' + message.utf8Data); // connection.sendUTF(" from server "+message.utf8Data); connection.sendUTF(" from server "+message.utf8Data); } else if (message.type === 'binary') { console.log('Received Binary Message of ' + message.binaryData.length + ' bytes'); connection.sendBytes(message.binaryData); }`
Hi, I want to send the broadcast to all clients connected to WebSocket
this code just send to the sender client I need all connected see the message
` var connection = request.accept('echo-protocol', request.origin); console.log((new Date()) + ' Connection accepted.'); connection.on('message', function(message) { if (message.type === 'utf8') {