Reputation: 1640
I need to run some function for every event from client in server node.js/socket.io This is about calculate average time between events so I can detect spamers.
Any ideas? In docs I didn't find it. Something like:
socket.onAnyEvent( function() {
//do things
});
Upvotes: 1
Views: 962
Reputation: 4104
Here is a good thread: https://github.com/LearnBoost/socket.io/issues/434 specifically you can extend the emitter.
Upvotes: 1