How can I increase the request limit if the user continues rate limiting?
My rate limiter:
const Limiter = rateLimit({
windowMs: 10000,
max: 5,
standardHeaders: true,
legacyHeaders: false,
keyGenerator: function (req) { return req.ip; },
message: async (req, res) => {res.render("429", {message: `IP ${req.ip} was rate limited.`}) }
})
I tried searching it at google but i did not find anything that could help me.
If you want the higher limit to apply to all users, change
maxfrom 5 to a higher number, e.g. 10, 50, etc.If you want the higher limit to apply to only some users, set
maxto a function that returns the correct value based on the request:Disclosure: I'm the author of express-rate-limit.