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
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Using STUN and TURN


As you know from Chapter 1, Developing a WebRTC Application, WebRTC uses the ICE technology and utilizes STUN/TURN servers when establishing a peer-to-peer connection process to break through firewalls and NAT. The difference between using STUN and TURN is schematically visualized in the following diagrams (we also used these diagrams in Chapter 1, Developing a WebRTC Application):

The following diagrams show a peer-to-peer connection using the STUN server:

The following diagram represents a general simple case of when the TURN server is used. Here, we have a situation where both peers use the same TURN server. We can see that peers use the STUN server to discover their network parameters and use the TURN server exchanging with media data. Technically, every TURN server can also serve as a STUN server. So, in the diagram, the STUN and TURN servers are represented as separate entities, but in the real world, they are usually one physical TURN/STUN server.

On the other hand...