Skip to content

HttpRequest

Defined in: index.cts:48

Incoming HTTP request passed to handleHttpRequest.

Extends Node.js stream.Readablereq.pipe(), req.on('data'), and req.on('end') all work as expected. The body is pre-read by WarpSocket and pushed synchronously as a single chunk, so the stream is immediately readable without waiting for async I/O.

The API is a useful subset of Node’s http.IncomingMessage. There are no 'data' / 'end' events beyond what the Readable provides, no access to the underlying socket, and no HTTP/2. WebSocket upgrade requests are detected automatically and routed through the normal handleOpen flow — they never reach handleHttpRequest.

  • ReadableStream

method: string

Defined in: index.cts:49


url: string

Defined in: index.cts:50


httpVersion: string

Defined in: index.cts:51


httpVersionMajor: number

Defined in: index.cts:52


httpVersionMinor: number

Defined in: index.cts:53


headers: Record<string, string>

Defined in: index.cts:54


rawHeaders: string[]

Defined in: index.cts:58

Raw headers as a flat alternating [name, value, name, value, ...] array, preserving the original wire order. Header names are lowercased (as normalised by the HTTP/1.1 parser).


remoteAddress: string

Defined in: index.cts:59


complete: boolean

Defined in: index.cts:61

Always true — the body is fully pre-buffered before the handler is called.


body: Buffer

Defined in: index.cts:63

Pre-read full request body. Also available via the Readable stream interface.