node.jshtmlwebsocketmousemove

Broadcasting mouse movements through Websockets


I have implemented a simple "online whiteboard" using Nodejs on the server side, and websockets on the client side.

A "master" sends mouse coords to all the other connected clients. Extremely simplified:

client..

whiteboard.onmousemove = 
function()
{
 Client_Send({x:event.pageX, y:event.pageY});
}

server..

socket.on("text") =
function(text)
{
 // ...GET A LIST OF CONNECTED USERS MINUS THE MASTER...
 Broadcast(users, text); 
}

The problem:

Is there some fundamental of websockets that I am missing here? (Using them for the first time)


Solution

  • It turns out the hiccup was created by flood protection policies configured on the Server's firewall. We never figured out how to configure policies so to protect from malicious flood but allow legit traffic, however disabling such policies entirely solved the bottleneck.