title: How to limit the amount of requests per ip in Node.JS?
body: <p>I'm was trying to think of a way to help minimize the damage on my node.js application if I ever get a DDOS attack. I want to limit requests per IP. I want to limit every IP address to so many requests per second. For example: No IP address can exceed 10 requests every 3 seconds. </p>
  
  <p>So far I have come up with this: </p>
  
  <pre><code> http.createServer(req, res, function() {
       if(req.connection.remoteAddress ?????? ) {
          block ip for 15 mins
        }
  }
  </code></pre>