Beyond HTTP: Cloudflare Opens a Bidirectional TCP Path to Edge Containers
Inbound TCP for Workers and bidirectional gRPC in Containers enter public beta, expanding edge application designs while introducing long-lived connection trade-offs.
HTTP request handlers are a natural fit for many edge applications. A voice stream or a long-lived native protocol needs a different connection model. On November 19, Cloudflare introduced public-beta inbound TCP for Workers and bidirectional gRPC in Containers. Its example routes a public TCP connection through Spectrum to a Worker’s connect() handler, then through a Durable Object to a container running a gRPC server.
The Worker and Durable Object forward bytes in both directions. In Cloudflare’s documented example, the container terminates TLS and handles HTTP/2 and gRPC; the intermediary code is not claiming to interpret every message. The example enables TCP half-closes to preserve a normal streaming behavior. This can support services such as real-time voice interactions where the client and server exchange data continuously.
A longer-lived edge contract
Passing a stream through several components changes the engineering questions. A service has to handle backpressure so a fast sender does not overwhelm a slow consumer, close both directions cleanly, recover from disconnects and account for container startup and readiness. Operators should test how connection duration, routing and state management behave under load and failure. The availability of a TCP path does not by itself prove the application will meet a particular latency or reliability target.
Cloudflare’s documented reference also defines a practical boundary for early adoption. Worker-origin Spectrum applications are available on Pro and Business zones and on Enterprise zones with Spectrum Enterprise enabled. Without Spectrum Enterprise, Pro and Business zones support one Worker-origin application per zone on one TCP port. The feature is in public beta, so production suitability and service terms should be checked against the actual deployment.
The larger architectural change is that the edge Worker can act as a programmable stream entry point while the container hosts an existing protocol server. Whether that simplifies a system depends on how the team handles TLS, connection lifecycle, state and the failure of each intermediary.