feat(http): support server-level timeout and socket options via app-config

Adds support for configuring server-level HTTP options through the
`app-config.yaml` file under the `backend.server` key. This includes
support for: `headersTimeout`, `keepAliveTimeout`, `requestTimeout`,
`timeout`, `maxHeadersCount`, and `maxRequestsPerSocket`.

These options are passed directly to the underlying Node.js HTTP server,
when omitted, the default values are used.

Refs: https://github.com/backstage/backstage/issues/21808
Refs: https://github.com/backstage/backstage/issues/30449
Signed-off-by: Beth Griggs <bethanyngriggs@gmail.com>
This commit is contained in:
Beth Griggs
2025-07-08 17:33:19 +01:00
parent bd7e339ed8
commit 8b91238021
6 changed files with 136 additions and 3 deletions
@@ -65,6 +65,14 @@ backend:
# - A standard ISO formatted duration string, e.g. 'P2DT6H' or 'PT1M'.
# - An object with individual units (in plural) as keys, e.g. `{ days: 2, hours: 6 }`.
serverShutdownDelay: { seconds: 20 }
server:
# (Optional) HTTP server configuration, Node.js defaults apply otherwise
headersTimeout: 60000
keepAliveTimeout: 5000
maxHeadersCount: 2000
maxRequestsPerSocket: 100
requestTimeout: 30000
timeout: 30000
```
### Via Code