Workers Can Now Accept Inbound TCP and Serve gRPC: Cloudflare Closes the HTTP-Only Gap

TL;DR
Cloudflare Workers can now accept inbound TCP and serve gRPC: a connect() handler via Spectrum, full-duplex gRPC from Containers, and gRPC-web translation.
Last updated: August 3, 2026
Since Workers launched in 2017, the platform could only be a server for HTTP traffic. You could open outbound TCP sockets to databases and services, but nothing inbound: no custom protocols, no raw sockets, no gRPC servers. On August 3, as part of Agents Week, Cloudflare announced the closing of that gap. Workers and Containers can now accept inbound TCP connections, and Workers can serve and call gRPC APIs with automatic protocol translation. It is in private beta today, with a signup form on the announcement post.
What shipped#
Three capabilities landed together:
-
connect(socket)handler: a new handler in the Workers runtime that accepts an inbound TCP socket. A Worker can read and write to it directly, pass it to another Worker, or hand it to a Durable Object. Cloudflare routes the raw TCP traffic through Spectrum, its existing ingress proxy for non-HTTP traffic, to the Worker you specify. -
Full-duplex bidirectional gRPC from Cloudflare Containers: a Worker accepts the socket and forwards it to a gRPC server running in a container, using
getTcpPort()on the container API. The announcement shows a Go gRPC echo server and a Pythonsocketserverexample that run unmodified. This opens any TCP-based protocol, in any language, to Cloudflare's 330+ location network. -
gRPC as a first-class Worker protocol: Workers can serve unary and server-streaming gRPC APIs and call external gRPC servers, no container required. The trick is protocol translation: your code uses gRPC-web (browser-compatible gRPC), and Cloudflare converts incoming gRPC to gRPC-web and outgoing gRPC-web to gRPC. Clients using native gRPC libraries like grpc-swift-2 and grpc-kotlin need no changes. The
@connectrpc/connectpackage provides the server and client plumbing.
Cloudflare has been translating gRPC internally since 2020, when it described the approach in its "Road to gRPC" post: convert requests to HTTP/1.1 so messages can be inspected and security features like WAF rules and Bot Management can apply.
Why it matters to developers#
The release targets one workload above all: real-time voice AI. Voice interfaces need low-latency, persistent, bidirectional connections between client, model, and supporting services. gRPC over a single TCP connection is a standard way to build that, and Cloudflare's pitch is that you can now run that stack on its edge network instead of on your own infrastructure or a cloud VM fleet.
Three developer-facing takeaways:
-
Workers stop being HTTP-only. Any TCP-based protocol can now terminate on Workers. The connect() handler pattern is a small, readable addition to the runtime, and the Durable Object integration means connection state has an obvious home. The example where a Worker pipes an inbound socket to a Durable Object, which pipes it to a container port, is the platform's full stack in 20 lines.
-
gRPC backends for mobile apps are now deployable without a container. If your mobile client already speaks gRPC for payload size and generated clients, a Worker can now be the backend, as long as your service shape fits unary or server-streaming calls. Bidirectional streaming still needs the container path.
-
Edge proximity finally applies to gRPC. The strongest use case is colocated inference: serving a gRPC API from locations near the client, where the model call stays close to the user. Combined with Containers for the parts that need a real userland, this is a meaningful option for latency-sensitive AI products.
The honest constraints#
Private beta means the API shape could change. The announcement is explicit that Cloudflare itself prefers Cap'n Proto and its JavaScript-native RPC system over gRPC, and that it wants to work with a smaller set of gRPC users before turning it on for everyone. So treat the code examples as direction, not a stable contract, until it goes public.
There is also the question of what inbound TCP on Workers means for abuse surface. Spectrum has always been the controlled ingress for non-HTTP traffic; adding a Worker in front of raw sockets keeps that control, and Cloudflare's WAF and Bot Management story continues to apply to translated gRPC traffic.
How it fits with adjacent tools#
This is the third day of Cloudflare's Agents Week, and the theme is consistent: the platform is building the raw material for agent infrastructure, not just agent SDKs. Inbound TCP and gRPC fit the same thesis as @cloudflare/computer (agents pick between isolates and containers) and the agent cloud positioning from the week's opening post. For real-time voice workloads, this post is the transport story behind the @cloudflare/voice channel in the Agents SDK.
The pattern is also familiar from other platforms. Vercel has been building durable execution and sandboxes for the same workloads, and Durable Objects on Workers have long been the closest thing to WebSocket state at the edge. Inbound TCP extends that to any protocol.
FAQ#
Can Cloudflare Workers accept inbound TCP connections?#
Yes, in private beta. A new connect(socket) handler in the Workers runtime accepts an inbound TCP socket that the Worker can read and write directly, pass to another Worker, or hand to a Durable Object. Cloudflare routes the raw TCP traffic through Spectrum to the Worker you specify.
Can a Worker serve gRPC without a container?#
Yes, for unary and server-streaming gRPC APIs. Your code uses gRPC-web, and Cloudflare converts incoming gRPC to gRPC-web and outgoing gRPC-web to gRPC, so clients using native gRPC libraries need no changes. Bidirectional streaming still needs the container path.
How does bidirectional gRPC work with Cloudflare Containers?#
A Worker accepts the inbound socket and forwards it to a gRPC server running in a container using getTcpPort() on the container API. The announcement shows a Go gRPC echo server and a Python socketserver example running unmodified.
What workload is inbound TCP and gRPC on Workers aimed at?#
Real-time voice AI above all. Voice interfaces need low-latency, persistent, bidirectional connections between client, model, and supporting services, and gRPC over a single TCP connection is a standard way to build that.
Is the inbound TCP and gRPC API stable?#
Not yet. It is in private beta, Cloudflare wants to work with a smaller set of gRPC users before turning it on for everyone, and the API shape could change, so treat the code examples as direction rather than a stable contract.
Continue Reading#
- @cloudflare/computer: an Agent Runtime That Treats a Container as a Tool, Not a Home
- Cloudflare Temporary Accounts for AI Agents
- OpenAI Realtime Voice API: Building Real-Time Speech Agents
- Vercel's Durable Execution Model for Background Agents
- Agent Sandbox Architecture: Isolates, Containers, and MicroVMs
Sources#
Get the next deep dive like this in your inbox
One email a week on News and the rest of the AI dev stack. Free.
Read next
@cloudflare/computer: an Agent Runtime That Treats a Container as a Tool, Not a Home
@cloudflare/computer is an open-source agent runtime: an SQLite-backed shared workspace plus a per-task choice between fast isolates and full Linux containers.
7 min readCloudflare Temporary Accounts: Let Agents Deploy Without OAuth Flows
Cloudflare temporary accounts let AI agents run wrangler deploy --temporary to ship Workers, D1 and KV without OAuth flows, then hand a human a claim URL.
6 min readOpenAI Realtime Voice API: Getting Started Guide
The Realtime API uses WebSockets for two-way voice interaction with function calling and stateful conversations. Here is how to set it up and build on it.
8 min readNew here? Start with
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.




