Transports

Ingenium is transport-agnostic. The default transport is node:http, but you can swap in Bun.serve, HTTP/2 (h2 and h2c), and enable WebSocket on the same app.

Node http (default)

const app = ingenium()
const server = await app.listen(3000)

Uses node:http directly. No translation layer to WinterCG Request/Response - the adapter writes straight from IncomingMessage to the IngeniumContext, and the IngeniumContext straight to the ServerResponse. This is what makes the per-request allocation budget so small.

Other transports

  • Bun.serve - drop-in BunAdapter for Bun.serve().
  • HTTP/2 - Http2Adapter (TLS) and Http2cAdapter (cleartext).
  • WebSocket - opt-in via the ws peer dependency.

Choosing a transport

const app = ingenium({ transport: new BunAdapter() })

The transport option on ingenium() is the single seam. Adapters present a uniform contract to the core router and middleware chain, so middleware that works on the default node:http transport works on Bun and HTTP/2 too.

Where to next?