Random chat explained

What Is a TURN Server? Relays Explained

Updated · 5 min read

What is a TURN server? It's a relay that carries a video or voice call between two devices when they can't connect to each other directly. Each side sends its encrypted audio and video to the TURN server, which forwards it to the other person. It's the backup route that lets a call work on networks that would otherwise block it.

TURN stands for Traversal Using Relays around NAT. To see why it's needed, it helps to understand NAT first, and then STUN, TURN's lighter-weight sibling.

The problem TURN solves: NAT

Your home router has one public internet address, but your phone, laptop and TV all share it. The router keeps track of which device asked for what and hands each reply to the right one. That system is called NAT, short for network address translation.

Think of an apartment building with one street address and a front desk. When you send a letter, the desk knows to route the reply to your apartment. But if a stranger sends you a letter out of the blue, addressed only to the building, the desk doesn't know whose it is and may turn it away.

That's the challenge for video calls: two devices, each behind its own front desk, both need to send each other unexpected mail. Video chat has wrestled with this from the beginning; early random chat sites leaned on browser plugins with their own workarounds, as our short history of random video chat explains.

STUN: finding your public address

A STUN server is a simple helper on the internet. Your device asks it, in effect, "What address do you see me coming from?" The answer is your public address and the port your router opened.

Each device shares that answer with the other through the website. Then both send data toward each other at the same moment, which convinces many routers that the incoming traffic is a reply. This is often called hole punching. When it works, the call goes direct, as our guide to peer-to-peer video chat describes.

STUN servers do very little work. They answer one quick question and step aside; they never carry the call.

TURN: the relay when direct fails

Some front desks are stricter. They only accept replies from the exact address you wrote to, or they block whole kinds of traffic. Then hole punching fails, and the two devices need a go-between.

A TURN server is that go-between, like a forwarding address both sides can reach. Each device sends its stream to the relay, and the relay passes it on. TURN can also run over the same ports and protocols as ordinary secure web traffic, so it can get through firewalls that block most other kinds.

STUN vs TURN at a glance

PointSTUNTURN
JobTells your device its public addressRelays the whole call
Carries your video?NoYes, in encrypted form
Resulting connectionDirect, peer to peerRelayed through the server
Cost to runVery lowHigher, because it carries every relayed stream
When it's usedOn nearly every call setupOnly when direct routes fail

In a browser call, both are tried through a process called ICE, which picks the best route that works. Our plain-English guide to WebRTC explains the rest of the setup.

Why services try direct first

A relay carries every second of every call that goes through it, and that bandwidth costs the service money. A direct route is usually faster too. So most video chat services attempt a direct connection first and bring in the relay only when they have to.

Why video calls use relay servers

Most calls on ordinary home internet connect directly. A relay is more likely when:

  • You're on a strict workplace or hotel network whose firewall blocks the traffic direct calls use.
  • You're on some mobile networks, where many customers share public addresses through the carrier's own NAT.
  • You're on public Wi-Fi that only allows basic web browsing.
  • You're using a VPN that doesn't pass the traffic direct calls need.
  • Both sides have strict routers, so neither can accept unexpected traffic.

If a call won't connect at all, the network may be blocking even the relay. Our guides on firewalls blocking video calls and VPN connection problems walk through the fixes.

What relaying means for speed

A relayed call takes a detour: your video travels to the relay and back out, rather than straight across. If the relay is close to both of you, the difference is small. If it's far away or busy, you may notice more delay or lower quality.

  • Try a different network, such as mobile data instead of office Wi-Fi, to see whether a direct route becomes possible.
  • On a VPN, pick a server near you, or turn it off briefly to compare.
  • A wired connection or strong Wi-Fi helps whichever route the call takes.

Lag doesn't always mean your call is relayed. A weak signal, a busy network or an older device cause most choppy calls, so check those first.

What relaying means for privacy

A TURN relay forwards your call, but it can't watch it. Browser calls are encrypted between the two browsers, and the relay doesn't have the keys. It sees scrambled data, plus the fact that two addresses are connected and how much data is flowing.

Don't count on a relay to hide your IP address from the other person, though. During setup, browsers usually share several possible addresses, including the public one, before a route is chosen. If you want your IP hidden from chat partners, use a reputable VPN.

On Omlet, calls are encrypted and peer-to-peer between you and your partner. Only when a direct connection isn't possible is the call relayed through Omlet's network provider, and either way Omlet doesn't record or store calls. If you're curious how it feels, start a video chat; you won't notice which route your call took.

Meet someone new right now — free, no sign-up, 18+

Start chatting

Frequently asked questions

Do all video calls use a TURN server?

No. Most calls connect directly with the help of STUN, and TURN is only used when a direct route fails. Services keep a TURN server ready as a fallback so calls still work on strict networks. You usually can't tell which route a call took, except that relayed calls can have slightly more delay.

Can a TURN server see my video?

Not on a standard browser call. The audio and video are encrypted between the two browsers, and the relay doesn't have the keys. It can see that two addresses are exchanging data and how much, but not the content. Whether a service records calls is a separate question; Omlet doesn't.

Is a TURN server the same as a VPN?

No. A VPN routes all your internet traffic through its server to hide your address from websites and networks. A TURN server relays a single call between two people and isn't designed to hide your IP from the other person. They can work together: a VPN for privacy, TURN for when a direct route fails.

Why would a call connect on mobile data but not on Wi-Fi?

The Wi-Fi network is probably blocking the traffic calls need, which is common on workplace and public networks. Mobile data takes a different route, so the call can succeed there. If you run the Wi-Fi router yourself, check its firewall settings; otherwise, mobile data is the simplest workaround.