I'm in the process of writting a highly scaleable browser based web chat server using nodejs. The concept involved is simple - first it checks browser for websocket support. If not suported or otherwise is incompatible with the server specs, it simply downgrades gracefully to the traditional long polling.
Taking advantage of its highly evented I/O model, I could not find any other framework out there so far so good and fit as nodejs for this kind of job. However, I have an issue relating to DOS attacks for which I decided to come up with a simple solution. However, I'm not so sure if it would be the most ideal way to combat against those massive flooding attacks.
What I plan do is - if 50 requests or more, originating from a single IP address, hits the server within a specific length of time(say 1 second), then deny all further request from that IP until that specific time interval comes to a lapse and so on.
Is this gonna be okay?