Let's say I have a socket.io event called 'add' which takes 0 parameters and when received on the server side, increments a count variable and then emits the new count value to every client. How can I stop people from essentially opening up the JS console and using a loop like:
for(var i = 0; i < 1000; i++) {
socket.emit('add');
}
Another scenario which may make more sense is: how can I detect flooding in, say, a chatting application?
I fully understand that there's nothing one can really do to ensure that client side code isn't manipulated by user.
How would one go about adding some form of timeout for each socketio event handler for each client?