
"To support HTTP client APIs, Cloudflare reimplemented the core node:http APIs by building on top of the standard fetch() API that Workers use natively, maintaining Node.js compatibility without significantly affecting performance. The wrapper approach supports standard HTTP methods, request and response headers, request and response bodies, streaming responses, and basic authentication. However, the managed approach makes it impossible to support a subset of Node.js APIs."
"Among the current limitations and differences with a standard Node.js environment, the Agent API is provided but operates as a no-op, and trailers, early hints, and 1xx responses are not supported. Furthermore, since Workers handle TLS automatically, TLS-specific options are not supported. The addition received positive feedback from the community, though some users noted that this feature should have been introduced earlier."
Cloudflare Workers now implement the node:http client and server APIs, enabling deployment of existing Express.js, Koa, and other Node.js applications to the edge without code rewrites. The implementation is a wrapper built on the native fetch() API to preserve Node.js compatibility while maintaining performance. The wrapper supports HTTP methods, headers, bodies, streaming responses, and basic authentication. Some Node.js features cannot be supported in the managed environment: the Agent API is a no-op, trailers, early hints, and 1xx responses are unsupported, and TLS-specific options are unavailable. Direct TCP is not available; networking and connection pooling are handled outside the Workers runtime. Community feedback was positive, with some users noting the capability arrived later than desired.
Read at InfoQ
Unable to calculate read time
Collection
[
|
...
]