Book Image

WebRTC Blueprints

By : Andrii Sergiienko
Book Image

WebRTC Blueprints

By: Andrii Sergiienko

Overview of this book

Table of Contents (13 chapters)
WebRTC Blueprints
About the Author
About the Reviewers

Using the TURN authentication

From Chapter 1, Developing a WebRTC Application, you know that we used such a construction to get a new peer connection object:

var pc = RTCPeerConnection(pc_config, pc_constraints);

The pc_config parameter in the preceding code is a set of configuration options that we want to use while creating the peer connection object.

In the previous chapter, we used only the STUN technology, and usually, pc_config was something similar to the following:

var pc_config = {"iceServers":

Here, you can see the two URLs of the ICE servers (we also discussed the ICE framework in Chapter 1, Developing a WebRTC Application), and they are both STUN servers.

In the same way, we can refer to a TURN server as follows:

  'iceServers': [
      'url': ''
      'url': '',
      'credential': 'UGJKBJHVYT',