From c5f7dcbb7e4be0c8d73e69df56df1c05e3413e24 Mon Sep 17 00:00:00 2001 From: Julia Johannesen Date: Sat, 17 Aug 2024 14:17:58 -0400 Subject: [PATCH] Come up with better limits --- .../backend/src/server/api/StreamingApiServerService.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/server/api/StreamingApiServerService.ts b/packages/backend/src/server/api/StreamingApiServerService.ts index db948122bf..19c78fd4d1 100644 --- a/packages/backend/src/server/api/StreamingApiServerService.ts +++ b/packages/backend/src/server/api/StreamingApiServerService.ts @@ -98,8 +98,8 @@ export class StreamingApiServerService { if (await this.rateLimitThis(null, requestIp, { key: 'wsconnect', - duration: ms('1min'), - max: 20, + duration: ms('5min'), + max: 32, minInterval: ms('1sec'), })) { socket.write('HTTP/1.1 429 Rate Limit Exceeded\r\n\r\n'); @@ -147,8 +147,8 @@ export class StreamingApiServerService { const rateLimiter = () => { return this.rateLimitThis(user, requestIp, { key: 'wsmessage', - duration: ms('1sec'), - max: 100, + duration: ms('5sec'), + max: 256, }); };