I'm working on a chat project based on Node.JS + SockJS (https://github.com/IgorAntun/node-chat) and I'm not sure on how to implement a rate limit so clients can't spam/flood the servers. Example: User X sent over 5 messages in less than Y seconds, so he would get temp-banned for spamming or something like that.
What would be the best approach for that?