diff options
author | Alex Gleason <alex@alexgleason.me> | 2024-05-26 00:16:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-26 10:46:05 +0530 |
commit | f8975a8ecbdb31e846ff1a583b9cdb0bd8a71fcc (patch) | |
tree | e91eb475871f83bd60b972cf96d67abfb1532096 /ext/http/02_websocket.ts | |
parent | 0ef1c774f6ed00d6cbe2de1ebd3f12da6c949394 (diff) |
fix(ext/websocket): change default idleTimeout to 30s (#23985)
Change the default server websocket `idleTimeout` to 30s to work with common Nginx setups which have a default timeout of 60 seconds
Diffstat (limited to 'ext/http/02_websocket.ts')
-rw-r--r-- | ext/http/02_websocket.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/http/02_websocket.ts b/ext/http/02_websocket.ts index 21f403bff..96af4d482 100644 --- a/ext/http/02_websocket.ts +++ b/ext/http/02_websocket.ts @@ -91,7 +91,8 @@ function upgradeWebSocket(request, options = { __proto__: null }) { const socket = createWebSocketBranded(WebSocket); setEventTargetData(socket); socket[_server] = true; - socket[_idleTimeoutDuration] = options.idleTimeout ?? 120; + // Nginx timeout is 60s, so default to a lower number: https://github.com/denoland/deno/pull/23985 + socket[_idleTimeoutDuration] = options.idleTimeout ?? 30; socket[_idleTimeoutTimeout] = null; if (inner._wantsUpgrade) { |