0

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?

Igor Antun
  • 116
  • 1
  • 2
  • 14
  • Also see [Introduction to Rate Limiting with Redis](http://www.binpress.com/tutorial/introduction-to-rate-limiting-with-redis/155) and [Better Rate Limiting](http://engineering.classdojo.com/blog/2015/02/06/rolling-rate-limiter/) and [Node Rate Limiter](https://github.com/jhurliman/node-rate-limiter) or [Using NGINX proxy for Rate Limiting](https://lincolnloop.com/blog/rate-limiting-nginx/). – jfriend00 Mar 21 '15 at 15:17
  • Thanks @jfriend00, I got it working by adapting [this](http://stackoverflow.com/questions/667508/whats-a-good-rate-limiting-algorithm) to javascript :) – Igor Antun Mar 21 '15 at 20:27

0 Answers0