---
id: "cloudflare-turn"
type: "component"
kind: "media-router"
provider: "cloudflare"
category: "edge"
docs: "https://developers.cloudflare.com/realtime/turn/"
url: "https://localhost:3000/catalogue/components/cloudflare-turn"
---

# Cloudflare Realtime TURN

Anycast TURN and STUN relay for WebRTC clients behind NAT or firewalls.

| | |
|---|---|
| Provider | [cloudflare](https://localhost:3000/catalogue?provider=cloudflare) |
| Kind | [Media router](https://localhost:3000/catalogue/kinds/media-router) |
| Category | Edge |
| Official docs | [https://developers.cloudflare.com/realtime/turn/](https://developers.cloudflare.com/realtime/turn/) |

## Properties

| property | type | values | required | kind default | this component |
|---|---|---|---|---|---|
| `anycast` | boolean | — | no | true | inherited |
| `cascading` | boolean | — | no | false | inherited |
| `managed` | boolean | — | no | false | **true** |
| `mode` | enum | `sfu`, `mcu`, `p2p`, `ingest` | no | "sfu" | **"p2p"** |
| `rerouteOnFailure` | boolean | — | no | false | inherited |
| `transport` | enum | `udp`, `tcp`, `both` | no | "both" | **"both"** |
| `turnPort` | integer | — | no | 3478 | inherited |
| `turnTlsPort` | integer | — | no | 5349 | inherited |

Bold values are the ones this component pins.

## Rules that apply · 0

No rule selects this kind or its category.

## Other products of the same kind · 23

- [Amazon Chime SDK](https://localhost:3000/catalogue/components/aws-chime-sdk.md) `aws-chime-sdk` — aws
- [Amazon IVS](https://localhost:3000/catalogue/components/aws-ivs.md) `aws-ivs` — aws
- [AWS Elemental MediaConnect](https://localhost:3000/catalogue/components/aws-mediaconnect.md) `aws-mediaconnect` — aws
- [AWS Elemental MediaPackage](https://localhost:3000/catalogue/components/aws-mediapackage.md) `aws-mediapackage` — aws
- [AWS Elemental MediaTailor](https://localhost:3000/catalogue/components/aws-mediatailor.md) `aws-mediatailor` — aws
- [Cloudflare MoQ](https://localhost:3000/catalogue/components/cloudflare-moq.md) `cloudflare-moq` — cloudflare
- [Cloudflare Realtime SFU](https://localhost:3000/catalogue/components/cloudflare-realtime-sfu.md) `cloudflare-realtime-sfu` — cloudflare
- [RealtimeKit](https://localhost:3000/catalogue/components/cloudflare-realtimekit.md) `cloudflare-realtimekit` — cloudflare
- [Agora](https://localhost:3000/catalogue/components/agora.md) `agora` — default
- [Ant Media Server](https://localhost:3000/catalogue/components/ant-media.md) `ant-media` — default
- [coturn](https://localhost:3000/catalogue/components/coturn.md) `coturn` — default
- [Daily](https://localhost:3000/catalogue/components/daily.md) `daily` — default
- [Icecast](https://localhost:3000/catalogue/components/icecast.md) `icecast` — default
- [Janus](https://localhost:3000/catalogue/components/janus.md) `janus` — default
- [Jitsi Videobridge](https://localhost:3000/catalogue/components/jitsi.md) `jitsi` — default
- [LiveKit](https://localhost:3000/catalogue/components/livekit.md) `livekit` — default
- [Generic media router](https://localhost:3000/catalogue/components/media-router.md) `media-router` — default
- [mediasoup](https://localhost:3000/catalogue/components/mediasoup.md) `mediasoup` — default
- [Red5](https://localhost:3000/catalogue/components/red5.md) `red5` — default
- [SRS](https://localhost:3000/catalogue/components/srs.md) `srs` — default
- [Twilio Video](https://localhost:3000/catalogue/components/twilio-video.md) `twilio-video` — default
- [Wowza Streaming Engine](https://localhost:3000/catalogue/components/wowza.md) `wowza` — default
- [Video Stitcher API](https://localhost:3000/catalogue/components/google-video-stitcher-api.md) `google-video-stitcher-api` — gcp

## Use it in a design

```yaml
nodes:
  - { id: "cloudflare-turn", component: "cloudflare-turn" }
```

## Source (`component` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../../schema/component.schema.json
# Cloudflare Realtime TURN: anycast relay for WebRTC clients behind NAT or firewalls.
# "When a client tries to connect to turn.cloudflare.com, it automatically connects to the
# Cloudflare location closest to them." STUN/TURN over UDP and TCP on 3478 and TURN over
# TLS on 5349, with 53, 80 and 443 as alternates ("TURN overview").
schemaVersion: "1"
type: "component"
id: "cloudflare-turn"
kind: "media-router"
provider: "cloudflare"
docs: "https://developers.cloudflare.com/realtime/turn/"
defaults:
  managed: true
  mode: "p2p"
  transport: "both"
properties:
  turnPort:
    type: "integer"
    default: 3478
  turnTlsPort:
    type: "integer"
    default: 5349
  anycast:
    type: "boolean"
    default: true
```

Human page: https://localhost:3000/catalogue/components/cloudflare-turn
