Skip to main content

Open Relay: Free WebRTC TURN Server


Need a Premium TURN Server

Metered also offers a premium TURN server service that automatically routes users to nearest server offering lowest possible latency. Plus also offer powerful REST API that allows creation, automatic expiry of credentials and ability to fetch detailed usage stats.

Learn more about it here.

Premium TURN server by Metered

What is a TURN Server?


WebRTC TURN Server is required to relay the traffic between the peers when direct connection cannot be established among them.

WebRTC protocol establishes a direct connection between the peers, but the sometimes a direct connection cannot be established for this a TURN Server is required to relay the traffic between the peers.

As peers cannot directly connect to each other the TURN Server acts as an intermediary among the peers and forwards the traffic from one peer to another.

All the traffic (video/audio + data) that passes through the TURN server is already end-to-end encrypted by the peers and the TURN Server cannot decode/read the encrypted packet, it just relays the packet to other peers.

turn server

Overview


Open Relay is a free TURN server provided by Metered Video that you can use in your WebRTC applications. The Open Relay TURN server is highly available, reliable and offers both STUN and TURN Capabilities.

The Open Relay runs on port 80 and 443 to bypass corporate firewalls, many corporate/enterprise firewall only allow port 80 or 443, it also supports turns + SSL for maximum compatibility.

  • ✅ Runs on port 80 and 443
  • ✅ Tested to bypass most firewall rules
  • ✅ Enterprise grade reliability (99.999% uptime)
  • ✅ Support TURNS + SSL to allow connections through deep packet inspection firewalls.
  • ✅ Support STUN
  • ✅ Supports both TCP and UDP
  • ✅ Dynamic routing to the nearest server
  • ✅ Production Ready
Signup for free account

Global TURN server Cloud Infrastructure

Nextcloud Talk TURN Server Setting

Toronto, Miami, San Francisco, Amsterdam, London, Frankfurt, Bangalore, Singapore,Sydney

✨ How to use


You can use the Open Relay TURN Server in your Javascript Code.

To use the TURN Server you will have to call the TURN Server REST API, the TURN Server REST API will return the iceServers array that you can use in the front-end.

The REST API automatically returns iceServers that are nearest to the geo-location of the user for the lowest latency.

info

To obtain your API_KEY sign-up for a free account.

Using the JavaScript Fetch() API


var peerConfiguration = {};

(async() => {
const response = await fetch("https://yourappname.metered.live/api/v1/turn/credentials?apiKey=API_KEY");
const iceServers = await response.json();
peerConfiguration.iceServers = iceServers
})();

var myPeerConnection = new RTCPeerConnection(peerConfiguration);

Using Axios


var peerConfiguration = {};

(async() => {
const response = await axios.get("https://yourappname.metered.live/api/v1/turn/credentials?apiKey=API_KEY");
const iceServers = response.data;
peerConfiguration.iceServers = iceServers
})();

var myPeerConnection = new RTCPeerConnection(peerConfiguration);

🔓 Credentials

To Connect to the Open Relay TURN Server, you need to sign-up for a free account and obtain your API Key.

Using the API you can call the end-point to fetch the iceServers array that you can use in the RTCPeerConnection.

Signup for free account

🔐 Static Auth

Services like Nextcloud Talk or Matrix+Synapse+Riot uses static auth instead of username and password authentication for the TURN Server. To use the TURN Server with those services use the static auth url which is staticauth.openrelay.metered.ca

secret: openrelayprojectsecret

TURN Server for Nextcloud Talk


Open Relay Project also works with Nextcloud talk, follow the instructions below to learn how to configure Nextcloud talk to work with Open Relay.

Nextcloud talk require the auth-secret-authentication so we have to use the Open Relay Project's TURN Server with auth-secret-authentication. Use the turn server url staticauth.openrelay.metered.ca with Nextcloud talk and turn secret: openrelayprojectsecret.

  • Go to Nextcloud-> Settings -> Talk and under TURN Servers press the + button
  • Then select turn:only
  • Under turnserver:port enter staticauth.openrelay.metered.ca:80
  • Under secret enter openrelayprojectsecret

Add another entry for port 443

  • Select turn:only
  • Under turnserver:port enter staticauth.openrelay.metered.ca:443
  • Under secret enter openrelayprojectsecret

Nextcloud Talk TURN Server Setting

🧰 Testing the TURN and STUN Server


You can test the TURN Server using our TURN Server Testing tool

Trickle ICE


Go to the TURN Server Testing tool website at: https://www.metered.ca/turn-server-testing and enter the TURN Server credentials.

1. Add TURN Server Info Add the TURN Server Credential. If you do not have the TURN Server credentials you can obtain them by signup for a free account.

2. Add STUN Server Info

Click the Launch Button to Launch the test. If you don't specify the STUN Server address it will not display your PUBLIC IP address.

🛡️Security


All the WebRTC traffic is end-to-end encrypted using DTLS-SRTP and the TURN server just relays the traffic. The TURN server only parse the UDP layer of WebRTC packet for routing purposes, and do not (and cannot) touch the DTLS encryption.

All the application layer data, include video and datachannel is encrypted using DTLS+SRTP and the TURN server cannot decrypt that data and it only relays the encrypted data among the peers.

You can read more about it here: https://webrtc-security.github.io/

To read more about the TURN proposed standard refer to RFC 5766

ℹ️ Contact


If you have any questions, comments or suggestions you can email us at contact[at]openrelayproject.org

🚀 Powered by Metered Video


Metered Video provides enterprise grade WebRTC video calling apis that you can use to create video conferencing applications that can scale upto thousands of simultaneous online users, with live streaming and recording capabilities.


Terms and Conditions

By using Open Relay Project Website or TURN server, you agree to our terms and conditions.