fix(dev-server): keep HTTP sockets alive through proxy request deadlines

This commit is contained in:
Clintchiz committed 2026-08-26 17:48:49 +05:30
1 parent 9e0907ffb2
commit 43bc2330b2
4 files changed
+6 -2

No files matched your search

+2
View File
@@ -654,6 +654,8 @@ export async function startGateway(opts: GatewayOptions): Promise<RunningGateway
port,
hostname,
development: mode === "development",
// Keep the socket alive long enough to return the configured proxy timeout.
idleTimeout: Math.min(255, Math.max(35, Math.ceil((limits.timeoutMs ?? 30_000) / 1000) + 5)),
maxRequestBodySize: maxBodyBytes,
async fetch(req, srv) {
const url = new URL(req.url);
+2
View File
@@ -634,6 +634,8 @@ export async function startServer(opts: ServeOptions): Promise<RunningServer> {
port,
hostname,
development: mode === "development",
// Cold page compilation can exceed Bun's default connection idle window.
idleTimeout: 35,
maxRequestBodySize: 10 * 1024 * 1024,
...(opts.tls ? { tls: opts.tls } : {}),
fetch(request, server) {