Skip to content

dispatchLocalRequest

Nodepod API


Nodepod API / src / http / dispatchLocalRequest

dispatchLocalRequest(port, method, path, headers, body?): Promise<CompletedResponse | null>

Defined in: src/polyfills/http.ts:1500

Deliver a request to the virtual server listening on a loopback port: the one in this worker if it owns the port, otherwise the one another process registered with the main thread. Resolves null when nothing listens there (and no bridge exists), so callers can fall back to the network. Used by the global fetch() patch so a pod command can talk to its own dev server the way node’s fetch reaches a local socket.

number

string

string

Record<string, string>

Buffer<ArrayBufferLike>

Promise<CompletedResponse | null>