What is Slyber TURN Server and why is it needed

Updated:
Author: Erkin Khidirov

How Do Internet Calls and Video Chats Work?

When you make a voice or video call in a messenger, browser, or mobile app, the application tries to connect your device to the other person's device directly (using a technology called WebRTC). A direct connection benefits everyone - audio and video travel along the shortest path with minimal latency.

In the real world, however, a direct connection is often impossible. The culprits are NAT and firewalls.

Why Can't Devices Connect Directly?

Imagine you want to send a courier with a package to a colleague working inside a large office building:

  1. Your colleague has an internal office number (for example, Room 105 - in the networking world, this is a local IP address like 192.168.1.5). But that number is useless until the courier knows the exact street address of the building itself.
  2. Moreover, there is strict security at the building entrance (a corporate firewall or a 4G/5G mobile carrier) that does not let couriers in from the street at all without prior authorization from the inside.

To solve this problem on the internet, two auxiliary protocols are used: STUN and TURN.

1. What Is STUN?

STUN is a lightweight service that a device asks: "What is my external street address and window number from the internet's perspective?"

  • The STUN server looks at the incoming request and replies: "You are accessing the internet from address 203.0.113.1, port 50000".
  • In simple home networks, this is enough - devices discover each other's external addresses and start communicating directly.

2. What Is TURN?

If at least one of the participants is on a "strict" network (corporate Wi-Fi, mobile internet with NAT, or a restrictive firewall), a direct connection is blocked. That is when a TURN server steps in:

  • Both call participants connect to the TURN server, which sits on the public internet and is accessible to everyone.
  • The TURN server allocates a dedicated virtual port for the call and begins forwarding (relaying) audio and video from one participant to the other.
  • Without a TURN server, roughly 15–25% of calls in the real world simply fail to connect.

What Is Slyber Turn Server?

Slyber Turn Server is a next-generation, high-performance STUN and TURN server written in Go and built as part of the Slyber communication engine ecosystem.

It handles the hardest part of audio and video calling - guaranteeing that users can hear and see each other across any network in the world.

Key Benefits of Slyber Turn Server:

  • All-in-One Binary: The server packs STUN, TURN (over UDP, TCP, and encrypted TLS), an HTTP API for issuing credentials, a monitoring system, diagnostics, and a load-testing tool into a single executable.
  • Automatic External IP Detection: The server can automatically discover its own public IP address via external STUN servers.
  • Security: Built-in protection against Server-Side Request Forgery (SSRF) attacks prevents malicious actors from using your TURN server to probe your company's internal network or cloud infrastructure.
  • Smart Mobile Network Handling: The server smoothly handles smartphone handovers from Wi-Fi to 4G/LTE without breaking session statistics.
  • Built-in "Doctor" and "Benchmark": With a single command, you can verify your network configuration (slyber_turn doctor) or stress-test the server while measuring latency and packet loss (slyber_turn bench).
  • Ready-to-Use API: Temporary call credentials can be issued directly via the built-in HTTP API.