ElSajko
ElSajko

Reputation: 1640

How to handle any event itself in socket.io

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

Answers (1)

Robert Peters
Robert Peters

Reputation: 4104

Here is a good thread: https://github.com/LearnBoost/socket.io/issues/434 specifically you can extend the emitter.

Upvotes: 1

Related Questions