Expire live caption state after inactivity and tune stream limits
This commit is contained in:
@@ -29,6 +29,7 @@ const limiter = rateLimit({
|
||||
limit: 500, // Limit each IP to 100 requests per `window` (here, per 15 minutes).
|
||||
standardHeaders: 'draft-8', // draft-6: `RateLimit-*` headers; draft-7 & draft-8: combined `RateLimit` header
|
||||
legacyHeaders: false, // Disable the `X-RateLimit-*` headers.
|
||||
skip: (req) => req.path.startsWith("/live-captions"),
|
||||
keyGenerator: (req) => {
|
||||
const forwarded = req.headers["x-forwarded-for"]?.split(",")[0]; // Take the first IP in the list
|
||||
const ip = forwarded || req.ip; // Fallback to req.ip
|
||||
|
||||
Reference in New Issue
Block a user