Web Hosting

Cloudflare opens inbound TCP and bidirectional gRPC to Workers

Published byNoura Mint ElySenior Technology ReporterNoura Mint ElySenior Technology Reporter Verified authorNoura Mint Ely is a Senior Technology Reporter at Desking, covering the latest developments in technology, artificial intelligence, enterprise software, cybersecurity, a…Author Profile
Advertisement

Ad disclaimer For links on this page, DESKING APP may earn a commission from the provider. This supports our work and has no influence on our editorial rating.

Cloudflare opens inbound TCP and bidirectional gRPC to Workers
Advertisement
Table of contents
  1. 1. What changed at ingress
  2. 2. How the connection travels
  3. 3. Access depends on zone limits
  4. 4. TLS remains an engineering decision
  5. 5. Where the new model fits
  6. Frequently Asked Questions

Cloudflare made inbound TCP connections to Workers and bidirectional gRPC in Containers publicly available in beta on November 19, 2026.

The change gives developers a way to expose TCP services through Cloudflare Spectrum, route connections into a Worker, and forward the stream to a Container running an existing server.

It matters most to teams building real time systems, device services and voice applications that rely on persistent connections rather than conventional HTTP requests.

The release addresses a specific limitation in the Workers model.

Workers could already initiate outbound TCP connections, but accepting public TCP traffic required a different ingress path.

With the new arrangement, Spectrum receives the connection and invokes a Worker’s connect() handler.

That Worker can process the socket itself or pass it through a Durable Object to a Container.

The result is a new deployment option, although its beta status, plan restrictions and TLS responsibilities deserve attention before production adoption.

1. What changed at ingress

1. What changed at ingress

The central addition is an inbound TCP handler in the Workers runtime.

A deployed Worker can now export a connect() function that receives a socket with readable and writable streams.

Spectrum acts as the public entry point, accepting a TCP connection and delivering it to the selected Worker.

This gives developers access to raw connection data, which is different from the HTTP request and response model handled by the familiar fetch() function.

The distinction matters because many network services do not communicate through ordinary web requests.

MQTT brokers, telemetry collectors, multiplayer services and custom binary protocols can depend on persistent TCP sessions.

Advertisement

Cloudflare identifies these as possible uses for Worker origins.

Developers can inspect incoming data, apply routing logic or forward the connection to an existing service.

The feature therefore expands the range of workloads that can sit behind Cloudflare’s network without requiring every backend to become an HTTP application.

Cloudflare’s November 19 announcement also introduced bidirectional gRPC support through Containers.

VPN

ExpressVPN

4.7
4.7

ExpressVPN delivers fast Lightway speeds, audited no logs privacy, and reliable streaming access across new Basic, Advanced, and Pro plans.

  • Very fast Lightway protocol speeds
  • RAM only TrustedServer infrastructure design
  • Pricier than most mainstream competitors
  • No permanent free plan available
Read review View Plans Affiliate Link

The company’s earlier product announcement had described the functionality as a private beta.

The November update moved inbound TCP and the Container based gRPC path into public beta.

That distinction is important: developers can now evaluate the service, but public beta availability should not be treated as a guarantee of production maturity or unchanged limits.

2. How the connection travels

2. How the connection travels

The published architecture uses four components: the client, Spectrum, a Worker, and a Durable Object connected to a Container.

Spectrum receives the public TCP session and invokes the Worker’s connect() handler.

The Worker opens another socket to a Durable Object, which then connects to the TCP port exposed by the Container.

Data travels in both directions across these connections, allowing the client and server to maintain a bidirectional stream.

The Worker is not acting as a gRPC server in this example.

Cloudflare’s documentation explains that it receives a raw TCP byte stream and does not parse gRPC or HTTP/2 frames.

The Container runs the actual gRPC server and handles the protocol processing.

This division is a useful architectural boundary: JavaScript code at the Worker layer can control routing, while an existing application written in another language can remain inside the Container.

Advertisement

The gRPC project describes bidirectional streaming as a call in which the client and server can independently send messages over their respective streams.

That behaviour suits applications where both sides need to communicate throughout one connection, including interactive voice systems and real time data exchange.

Cloudflare’s implementation preserves the underlying connection in both directions rather than translating the stream into a sequence of conventional HTTP requests.

The architecture can be understood through the responsibilities of each component:

  • Spectrum: Accepts the public TCP connection and sends it to the configured Worker origin.
  • Worker: Receives the socket through connect() and decides where the stream should go.
  • Durable Object: Provides the intermediary connection to the Container in Cloudflare’s documented gRPC example.
  • Container: Runs the application server, including the gRPC implementation and protocol handling.

This separation allows developers to keep an existing TCP or gRPC server while changing how clients reach it.

A team does not necessarily need to rewrite a service as an HTTP endpoint to expose it through this route.

However, the additional components also create more places to configure, observe and troubleshoot.

The design is an architectural option, not an automatic migration of an existing server.

3. Access depends on zone limits

3. Access depends on zone limits

Public beta access is not available on every Cloudflare plan.

Worker origin applications are supported on Pro and Business zones, as well as Enterprise zones with Spectrum Enterprise enabled.

Free zones are not supported.

Without Spectrum Enterprise, a Pro or Business zone is limited to one Worker origin application per zone, using one TCP port.

Spectrum Enterprise access is separate from simply having an Enterprise zone subscription.

The current restrictions have direct consequences for deployment planning.

A business with several TCP services cannot assume that one Pro or Business zone can expose all of them through separate Worker origin applications.

The single port restriction also means that a service requiring several public TCP ports needs a different design or an eligible Enterprise arrangement.

Advertisement

These are product availability constraints, not just configuration details.

Access arrangementWorker origin availabilityApplication limitTCP port support
Free zoneNot supportedNoneNot available
Pro zonePublic betaOne per zoneOne port
Business zonePublic betaOne per zoneOne port
Enterprise with Spectrum EnterpriseSupportedSubject to Enterprise accessSingle port per application


The table describes access to Worker origin applications, not the complete cost of running the application.

VPN

ExpressVPN

4.7
4.7

ExpressVPN delivers fast Lightway speeds, audited no logs privacy, and reliable streaming access across new Basic, Advanced, and Pro plans.

  • Very fast Lightway protocol speeds
  • RAM only TrustedServer infrastructure design
  • Pricier than most mainstream competitors
  • No permanent free plan available
Read review View Plans Affiliate Link

Cloudflare states that Workers usage is billed separately from Spectrum.

Container consumption and other platform resources also need to be considered.

A subscription that makes the ingress feature available should therefore not be mistaken for an all inclusive price for the complete service.

Azeem Hassni, a software engineer and solutions architect, independently summarized the November announcement and highlighted the same connection path from Spectrum through a Worker and Durable Object to a Container.

His account is useful as an outside technical explanation, but it is not a published performance test or an independent production deployment report.

At the time of writing, there is not enough public hands on evidence to establish real world latency, throughput or reliability under different workloads.

4. TLS remains an engineering decision

4. TLS remains an engineering decision

Encryption needs deliberate planning because the network path does not automatically mean that Spectrum terminates TLS for every eligible plan.

Cloudflare’s documented architecture forwards encrypted bytes through the Worker and Durable Object, with the Container terminating TLS and handling HTTP/2 and gRPC.

This means the backend service remains responsible for its certificate and TLS configuration in the documented Pro and Business arrangement.

The distinction is important for teams that currently rely on Cloudflare to terminate TLS at the edge.

The public beta should not be assumed to provide that same behaviour for every Worker origin.

Advertisement

Spectrum Enterprise supports edge TLS termination, while the Pro and Business Worker origin path passes TCP traffic through without terminating TLS.

A service that needs encrypted client connections must account for where the TLS handshake takes place and who manages the certificate.

The TCP protocol also has connection behaviour that a simple byte forwarding example can obscure.

Cloudflare’s sample uses allowHalfOpen: true so that TCP half closes are preserved as the stream moves between components.

This matters when one side finishes sending data while still expecting to receive a response.

The TCP specification defines connection shutdown and state handling, so a proxy that mishandles these transitions can create failures that are difficult to distinguish from application bugs.

Before exposing a service, developers should check the following operational details:

  • Certificate ownership: Decide which component stores and renews the certificate used by the public service.
  • Backend termination: Confirm that the Container can terminate TLS and serve the required HTTP/2 and gRPC traffic.
  • Connection closure: Test client initiated and server initiated shutdown, including half close behaviour.
  • Port allocation: Confirm that the application can operate through the single public TCP port available under the applicable plan.

There is another important limitation for legacy protocols.

Cloudflare’s routing documentation states that inbound Spectrum sockets cannot be upgraded with socket.startTls().

A protocol that begins in plaintext and later negotiates TLS through STARTTLS therefore needs a backend that handles that upgrade.

Teams should check this before moving mail, messaging or other legacy services to the new path.

The presence of TCP support does not mean every TCP based protocol will work without additional changes.

5. Where the new model fits

The strongest use case is a service that already speaks TCP or gRPC and needs a Cloudflare managed public ingress route.

Voice applications are an obvious example because they can maintain a stream while the client and server exchange messages.

Device telemetry, MQTT and custom binary protocols are other plausible workloads identified in Cloudflare’s documentation.

Advertisement

These applications can benefit from a Worker based routing layer while retaining their existing server implementation in a Container.

The feature is less compelling when a service already works well over HTTP or WebSockets.

Workers have established request handling through fetch(), and WebSockets already provide persistent two way communication for many application designs.

Moving to raw TCP introduces port, TLS and connection management responsibilities.

Developers should choose it because the protocol or existing service requires TCP, not simply because inbound sockets have become available.

VPN

ExpressVPN

4.7
4.7

ExpressVPN delivers fast Lightway speeds, audited no logs privacy, and reliable streaming access across new Basic, Advanced, and Pro plans.

  • Very fast Lightway protocol speeds
  • RAM only TrustedServer infrastructure design
  • Pricier than most mainstream competitors
  • No permanent free plan available
Read review View Plans Affiliate Link

The practical decision can be divided into a few common situations:

  • Existing gRPC backend: Consider the Container route when the service requires native bidirectional gRPC and the existing server should remain intact.
  • Custom TCP service: Consider a Worker origin when clients need a public TCP endpoint and the application can operate within the available port restrictions.
  • HTTP based application: Keep the established HTTP request path unless the protocol requirements justify a persistent TCP connection.
  • Legacy STARTTLS service: Retain or introduce a backend that performs the TLS upgrade, because the inbound socket cannot perform that upgrade through socket.startTls().

There are still unanswered production questions.

The public announcement and documentation establish the architecture and current access restrictions, but they do not provide independent benchmark results for latency, concurrent connections or sustained throughput.

Nor does a public beta establish how the service will behave under every failure condition or workload profile.

Teams considering a migration should test connection recovery, certificate renewal, observability, capacity and billing with their own traffic patterns before committing a critical service.

For now, the release is a meaningful extension of the Workers platform for developers whose applications need inbound TCP.

Its value is clearest when a team wants Cloudflare at the network edge but does not want to replace an existing TCP or gRPC server.

The one application and one port limits on Pro and Business, the separate billing layers and the TLS responsibilities make eligibility and architecture checks essential.

It is a useful beta to evaluate, not yet a reason to move every persistent service.

Frequently Asked Questions

Can a Worker run a gRPC server directly?
The documented bidirectional gRPC path runs the gRPC server inside a Cloudflare Container. The Worker receives the raw TCP socket and forwards the stream, while the Container handles HTTP/2 and gRPC. Cloudflare has separately described other gRPC capabilities for Workers, including unary and server streaming APIs through gRPC Web conversion. Those are different mechanisms and should not be confused with the native bidirectional Container example.
Does an HTTP CONNECT request trigger connect()?
No. Cloudflare specifies that sending an HTTP CONNECT request to a Worker’s public URL does not invoke the inbound TCP connect() handler. The handler is reached through a Spectrum application configured with a Worker origin. This distinction matters when testing the feature, because an HTTP proxy request to the Worker URL is not an equivalent test of the public TCP ingress route.
Can one zone expose several TCP ports?
A Pro or Business zone without Spectrum Enterprise supports one Worker origin application per zone, configured for one TCP port. Port ranges are not supported by this beta configuration. Enterprise customers with Spectrum Enterprise have a different access arrangement, but each Worker origin application still uses a single TCP port. Teams that need multiple public services should confirm their intended architecture and subscription before migration.
Is inbound TCP available on Cloudflare Free?
No. Free zones are not supported for Worker origin Spectrum applications. The documented entry arrangements are Pro or Business zones, or Enterprise zones with Spectrum Enterprise enabled. Developers also need to account for Workers usage being billed separately from Spectrum. The total cost therefore depends on the relevant subscriptions and resource consumption, rather than the zone plan alone.
Can Cloudflare terminate TLS for every Worker origin?
No. In the Pro and Business arrangement without Spectrum Enterprise, Spectrum passes TCP traffic through without terminating TLS. The backend service must handle the encrypted connection. Spectrum Enterprise supports edge TLS termination, subject to its configuration and certificate requirements. Developers should verify where TLS terminates before exposing a production service, particularly when migrating an application that previously relied on edge termination.
Is the feature ready for production workloads?
It is in public beta as of November 25, 2026. Public beta access allows developers to test the feature, but it does not establish production performance or reliability for every workload. No independent benchmark or broad set of documented production deployments was available in the research reviewed for this article. Teams should run controlled tests with representative traffic and failure scenarios before moving critical services.
Sources5

External pages are independent third-party sources. Desking App does not control or endorse their content and accepts no responsibility for it. Visiting them is at your own responsibility and risk.

Advertisement

Web Story

Short on time? Watch this article as a story

Cloudflare’s public beta lets Spectrum route inbound TCP into Workers and relay bidirectional gRPC streams to Containers, but access requires eligible zone plans, TLS planning, and Workers and…

9 pages about 3 min

Watch the story
Advertisement

Liked this? Get the next one in your inbox