IKHSAN
ENID Baca dalam Bahasa Indonesia

homeio

Public

Forked from doctor-io/homeio

Branch
main
Latest commit
958d74616 October 2026

keep-alive.test.ts

Open raw
import { createServer } from "node:http";
import { describe, expect, it } from "vitest";
import {
  NGINX_UPSTREAM_KEEPALIVE_MS,
  configureUpstreamKeepAlive,
} from "@/lib/server/http/keep-alive";

describe("configureUpstreamKeepAlive", () => {
  it("keeps idle connections open longer than nginx reuses them", () => {
    const server = createServer();

    configureUpstreamKeepAlive(server);

    expect(server.keepAliveTimeout).toBeGreaterThan(NGINX_UPSTREAM_KEEPALIVE_MS);
    expect(server.headersTimeout).toBeGreaterThan(server.keepAliveTimeout);
  });
});
bytes
565
lines
18
Type
ts
Latest commit
16 October 2026