From 9a5a8c7e5dbabce7d52077529043911eb32d23ab Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 00:58:51 +0000 Subject: [PATCH] Cap websocket client payload size in runtime Co-authored-by: Theo Browne --- apps/t3/src/runtimeApiServer.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/t3/src/runtimeApiServer.ts b/apps/t3/src/runtimeApiServer.ts index d316e482ca..621f7911b1 100644 --- a/apps/t3/src/runtimeApiServer.ts +++ b/apps/t3/src/runtimeApiServer.ts @@ -94,6 +94,7 @@ interface JsonRpcErrorResult { } const BOOTSTRAP_SESSION_TIMEOUT_MS = 3_000; +const MAX_WS_CLIENT_PAYLOAD_BYTES = 5 * 1024 * 1024; interface BootstrapSessionResult { session: ProviderSession; @@ -467,6 +468,8 @@ export async function startRuntimeApiServer( const wss = new WebSocketServer({ host: "127.0.0.1", port: options.port, + maxPayload: MAX_WS_CLIENT_PAYLOAD_BYTES, + perMessageDeflate: false, }); const isAuthorizedConnection = (requestUrl: string | undefined) => {