bedrock-request-limiter

Bedrock request limiter

Usage no npm install needed!

<script type="module">
  import bedrockRequestLimiter from 'https://cdn.skypack.dev/bedrock-request-limiter';
</script>

README

bedrock-request-limiter

A bedrock module that adds HTTP(S) request limiting to bedrock-express to, for example, help mitigate DoS attacks.

bedrock-request-limiter is built using redback.

Requirements

  • npm v3+

Quick Examples

npm install bedrock-request-limiter

Request limiting is controlled via the configuration system; simply include bedrock-request-limiter and set the maximum number of requests per IP per hour to allow.

var bedrock = require('bedrock');

require('bedrock-server');
require('bedrock-express');
require('bedrock-request-limiter');

// limit number of requests per hour per IP address (0 means no limit)
bedrock.config.limiter.ipRequestsPerHour = 3600;

bedrock.start();

Configuration

For more documentation on configuration, such as where to set your Redis host, port, and password information, see config.js.