From the course: Node.js: Security

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Rate limiting against DoS attacks

Rate limiting against DoS attacks - Node.js Tutorial

From the course: Node.js: Security

Rate limiting against DoS attacks

- [Narrator] Like we've mentioned before, DoS attack will typically overwhelm your servers with request until your server's I/O is overloaded, and therefore shuts itself down. This can be prevented by eliminating the number of requests in a specific amount of time. And this can be prevented from an express middleware called Express rate-limit. There is also a module called Rate limiter, but it has a Redis dependency. So if you're not a fan of adding extra packages when not needed, then use the express one. If you're using Redis in your application, feel free to use the MPM module. So let's explore adding the Express-rate-limit module. So the first thing we're going to do is go back to our terminal. I'm going to minimize my editor, and then go into the terminal where I have CRM, or the project that we have here already open. Okay, so now we're going to install Express-rate-limit, and I'm going to also install L Map because I want to set it up as well in this video. So I'm going to do…

Contents