In order to do WebRTC across different networks, we need to bypass firewalls and we also have all kinds of restrictions set by ISPs, in order to bypass this restrictions and punch a hole in the receptors firewalls to get media through we need to rely on a STUN/TURN server, to either find the right route if possible (STUN), or act as a relay server for the media passing through (TURN), in this brief guide we setup a basic STUN/TURN server.

We’ll use an open source implementation of a STUN/TURN server, Coturn.

Installing Coturn.

Assuming you are on a Ubuntu 14.04 LTS server run the following commands:

When the installation is ready, run the following command in your terminal:

Testing your STUN/TURN server.

In order to test your TURN server, you can make use of this tool provided by the WebRTC team: https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/

Input your server information like this:

trickle-ice form
Fig. 1: trickle-ice form for the input of server credentials

A successful output from testing TURN should look like this:

trickle ice test results
Fig. 2: successful results from a TURN server

You can see two rows that say relay, this indicates that the TURN server is working correctly, if there’s nothing that says relay on this output, the TURN server is not working as expected.

Keep in mind, this is not a setup appropriate for production environments, it’s simply to have a way to test your WebRTC application without the need of purchasing a TURN server or getting it by other means.

If you want to know more about WebRTC solutions, need assessment, or just want to have a quote on our services, Contact us!

Recent Blog Posts