TURN relays media between call participants when their networks refuse to let them connect directly. Cloudflare Calls' TURN service, in open beta since April, is now generally available to all Cloudflare accounts, and it runs on the company's anycast network rather than on servers a customer has to place and scale.

Teams that decide to build their own relay infrastructure usually end up asking how to reach every user with near-zero latency, where to put the servers, and how to auto-scale without trading away performance. A hosted TURN service is Cloudflare's answer to those questions.

Why direct connections fail

IPv4 (RFC 791) assumed a 32-bit address space would cover every connected computer, and that assumption did not survive smartphones and the Internet of Things. Because TCP and UDP both expose up to 65,535 port numbers per address, engineers learned to share one public IP among many devices through Network Address Translation.

In a typical NAT deployment, a device's outbound packet is mapped to a random unused port and recorded in a forwarding table, so replies can be routed back to the right device. This works when the internal device opens the connection and waits. Real-time audio and video break that model: NATs do not disclose how they assign ports, so peers cannot tell each other in advance where responses should go. STUN (RFC 3489) addressed part of the problem but not all of it, which is why the TURN protocol exists. TURN relays traffic predictably between devices with minimal delay, and a second of lag is enough to ruin a call.

ICE decides when a relay is required

ICE (RFC 8445) seeks the fastest path between peers by probing several routes and picking the one with the least delay. If a direct peer-to-peer path cannot be established, or is not fast enough, ICE falls back to a TURN relay.

BLOG-2530 image 1

The fallback carries a privacy cost. ICE has endpoints exchange every candidate address they have — local IPs, NAT IPs, TURN server addresses — which can leak network topology, approximate location, and details of the local network. The brute-force probing pattern itself can also be distinctive enough for a sophisticated observer to infer which application or protocol is in use. For people who rely on end-to-end encrypted messaging, such as journalists talking to unknown sources, that exposure matters.

Privacy through a relay

With Cloudflare's TURN in the path, call traffic is proxied through Cloudflare, so neither party sees the other's client IP address or associated metadata. Cloudflare forwards the media without inspecting it; the call payload stays end-to-end encrypted. The company points to its existing privacy-preserving proxies — Consumer WARP, Apple's Private Relay, and Microsoft Edge's Secure Network — as evidence it can operate this kind of service at scale.

Anycast as the delivery model

Many real-time services run their own TURN servers on a commercial cloud, since leaving a share of users unable to connect is not acceptable, and absorb the DevOps and egress costs. Deploying and running something like CoTURN on a VPS is also thankless work for most engineers. Because a relay adds delay to every packet, it should sit as close to the peers as possible; Cloudflare's TURN runs in all 330 cities where Cloudflare has data centers, and new cities pick up the service automatically.

Anycast lets many servers in different locations share one IP address; BGP routes each client's request to the topologically nearest one, much as emergency numbers reach the closest dispatch center. Roughly 95% of the Internet-connected population is within about 50ms of a Cloudflare location, which is what makes the model viable for real-time traffic.

Scaling and allowlisting

Anycast spreads load across servers according to network topology, so customers do not manage regional server lists or write custom VM scaling logic. Fewer IP addresses also make the service easier to allowlist in restrictive networks.

Stateless traffic, such as DNS over UDP and the stateless STUN binding requests used to discover a system's external address, suits anycast well. Stateful UDP protocols like QUIC and TURN are harder. QUIC gets help from its stable connection ID; TURN and STUN have no equivalent. The Unimog load balancer therefore keeps all of a TURN client's requests pinned to one server inside a data center. Cloudflare has documented these anycast load-balancing problems before.

Two connection types, two routing strategies

A TURN session involves the client-server connection and the relayed address used by the third party. The client-server leg uses the published IP and port over anycast. The relayed address cannot: the protocol requires those packets to reach the specific server handling the client, and anycast routing could deliver them to the wrong data center or server. The unicast alternative exposes servers to attack and consumes many IP addresses.

Cloudflare's middle ground, described previously in "Cloudflare servers don't own IPs anymore – so how do they connect to the Internet?", keeps anycast addresses but adds handling for misdelivered packets: anything arriving at the wrong Cloudflare location is carried over the company's backbone to the correct data center instead of being sent back across the public Internet. Packets for the relay address therefore enter the network as close to the sender as possible, which also speeds up the TURN connection itself.

BLOG-2530 image 2
BLOG-2530 image 3

Availability and pricing

The service is billed on usage and open to self-serve and Enterprise customers. The first 1,000 GB (one terabyte) of Cloudflare Calls usage each month is free; self-serve pricing is five cents per GB beyond that, and Enterprise customers can arrange volume pricing with their account team. Moving from another TURN provider is likely a single configuration change in the real-time app. A TURN app can be created from the Cloudflare Calls Dashboard, and the Developer Docs cover the setup.