feat: add concurrent connection limits

Signed-off-by: hgshreyas <hgshreyas.cs24@bmsce.ac.in>
This commit is contained in:
hgshreyas committed 2026-08-09 17:27:47 +05:30
1 parent 1030109efa
commit 9e5e5cffe9
9 files changed
+28 -3

No files matched your search

+1
View File
@@ -59,6 +59,7 @@ export function createHttpServer(
const server: http.Server = (opts?.tls
? nodeHttps.createServer(opts.tls as https.ServerOptions, handler)
: nodeHttp.createServer(handler)) as unknown as http.Server;
server.maxConnections = opts?.limits?.maxConnections ?? 1000;
server.requestTimeout = opts?.limits?.requestTimeoutMs ?? 30_000;
server.headersTimeout = opts?.limits?.headersTimeoutMs ?? 10_000;
server.keepAliveTimeout = opts?.limits?.keepAliveTimeoutMs ?? 5_000;