express-brute icon indicating copy to clipboard operation
express-brute copied to clipboard

Implementation Question

Open imRohan opened this issue 3 years ago • 0 comments

I had a question regarding my implementation, and I was wondering if what I am experiencing is a result of bad configuration on my part.

Essentially, I am trying to limit requests of a particular route to 20 requests every 10 seconds. My thinking was that if the maxWait and the lifetime were both set to 10seconds then the freeRetries counter would reset every 10 seconds. Allowing users to once again request up to 20 times before having to wait.

Is this correct?

const bruteForce = new expressBrute(store, {
  freeRetries: 20,
  minWait: 5000, // 5s
  maxWait: 10000, // 10s
  lifetime: 10, // 10s,
})

imRohan avatar Jan 18 '22 13:01 imRohan