AdamPflug / express-brute

Brute-force protection middleware for express routes by rate limiting incoming requests
MIT License
564 stars 91 forks source link

Query: Can you give an example of a fibonacci type delay ? #88

Closed puneetmakkar closed 4 years ago

AdamPflug commented 4 years ago

It just means that the minimum time between 2 allowed requests after your free retries are used grows similar to the Fibonacci sequence (the minimum delay for any request is equal to the sum of the minimum delays for the previous 2 requests).

In practice this interacts with minWait and maxWait so that the effective minimum time between requests after free retries are used is [minWait*1, minWait*1, minWait*2, minWait*3, minWait*5, minWait*8, minWait*13, minWait*21, ...] Increasing until you reach maxWait. In this way it's only fibobacci-like because the actual delays are not necessarily numbers on the Fibonacci sequence and because there is a maximum delay amount.

puneetmakkar commented 4 years ago

Thanks @AdamPflug for the explanation.