Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning WebRTC

You're reading from  Learning WebRTC

Product type Book
Published in Jun 2015
Publisher
ISBN-13 9781783983667
Pages 186 pages
Edition 1st Edition
Languages
Author (1):
Daniel M. Ristic Daniel M. Ristic
Profile icon Daniel M. Ristic

Table of Contents (16) Chapters

Learning WebRTC
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with WebRTC 2. Getting the User's Media 3. Creating a Basic WebRTC Application 4. Creating a Signaling Server 5. Connecting Clients Together 6. Sending Data with WebRTC 7. File Sharing 8. Advanced Security and Large-scale Optimization Answers to Self-test Questions Index

Chapter 8. Advanced Security and Large-scale Optimization

Up to this point, we have covered a shallow portion of the entirety of WebRTC. This has been limited to what we could build in a chapter inside our local computer without hooking up to any real services. This is great if it's only limited to you or a few of your friends but, unfortunately, this will not lead you to being able to connect thousands of people across the world. To do this, we will have to dive into deeper and more advanced topics, such as security, performance, and supporting large-scale networks.

The aim of this chapter is to provide a small amount of information on these topics so that you can research them in more depth at your leisure. Most of the information will be conceptual and we will not build a working demo in this chapter. By the end of the chapter, you should have a good idea of what concerns you will have when building a large-scale WebRTC-based service and where to go for more information.

Researching and...

Securing the signaling server


What we have built so far has been in the spirit of teaching a single part of the WebRTC API. This means many shortcuts were taken and we sacrificed performance and security to make it easier to learn. Our signaling server, although it works, is simple in nature and can be upgraded to support a much larger set of features.

Using encryption

The largest and most obvious upgrade is mandatory encryption of the signaling server. Encrypting the messages of the signaling server will ensure that no one can intercept a message to the server, thus figuring out which clients are talking to whom. This is easily the largest gap in security that the signaling server we built has right now. It is also the easiest to patch up since encryption is a highly standardized and widely used technology on the Web today.

The two standard encryption methods for our signaling server are HTTPS and WSS. You should recognize HTTPS by now as the standard SSL encryption for websites over HTTP...

Supporting mobile devices


With the meteoric rise of the Web on mobile devices, most developers will have to support WebRTC calling on phones at some point. It is the medium that is most often paired with the idea of web-based calling. The idea of ditching expensive minute plans and sticking with a data service is an alluring concept. Also, a web page can make use of the microphone and camera already attached to the device instead of needing to purchase these items for a desktop computer. In these cases, however, the low power and cellular-based network connectivity can become an issue for streaming applications.

While sending data between a desktop and a mobile phone, the first major issue will be the data connection. As fast as phone networks are getting, the connection speed will still be much lower than a standard desktop computer wired into a wall. If the phone does not have a great connection, the call quality of a WebRTC connection will be much worse than a standard phone call that...

Introduction to mesh networking


Once your WebRTC application is working on multiple devices with a reasonable amount of security, the next question is: how do I scale this up to multiple users? One-to-one calls are great, but what if we can connect several users together inside one call? This is where we begin to dive into the world of mesh networking.

Mesh networking is a topic that has been around for a while. It's a term used in almost any technology that deals in the networking of multiple computers. In its most basic sense, a mesh network represents a set of computers that can all communicate with each other directly. Each node is connected with every other node in the network and no one node is responsible for the entire network:

There is a good chance that you have encountered many mesh networks in your lifetime. For example, the Internet is already a form of mesh network. So, when you send out a request for a certain web page, every node on the network works together to deliver that...

Video conferencing with more users


Many large-scale communication companies have made the transition to server-client methods of networking vast number of users. There have been a wide number of different solutions that work in many ways, but they are all built on the principal of using servers as nodes in the network instead of clients. These MCUs give networks better stability, performance, and a better overall user experience at the cost of being expensive.

The type of network that uses a MCU works similar to a star network mesh, where a server is the host machine instead of any single user. This allows the call to be controlled from a central location that has high availability and stability. It also allows the developers of the application to scale the bandwidth of the network, keeping in mind the needs of the user base:

This also gives the network a lot of control over how the users connect and interact with each other. This is a fine-grain control of the user experience. The following...

The future of conference calls


This is just the tip of the iceberg when it comes to large-scale WebRTC applications. With the globalization of technology communication, platforms are not going to go out of style anytime soon. It is an industry that will continue to be invested in by many large corporations. This means that the technology presented here is going to become more accessible and powerful over time.

The big thing to remember is that none of the technology presented in this chapter is anything new for WebRTC. All of these concepts have been around for years before WebRTC hit the scene. This means there is an entire wealth of technologies and products that have already been tested and just need to be converted for usage within the WebRTC space.

On top of the large amount of technology that already exists, there are many ways to improve and innovate on the idea of multiuser communication. With the entire web framework at your disposal, there are new ways that this technology can be...

Self-test questions


Q1. The technologies you can use to secure your signaling server include:

  1. HTTPS

  2. WSS

  3. OAuth

  4. All of the above

Q2. The biggest problem when supporting mobile users is the resolution of the camera on their mobile device. True or False?

Q3. What is a large concern when building a mesh network?

  1. The OS of the user's computer

  2. The browser that each user is running on

  3. The bandwidth available on the user's network

  4. What OAuth method the user logged in with

Q4. A star network is where everyone connects to one host node in the network and this node serves all the other users. True or False?

Q5. Mesh networks give the most optimal user experience in favor of ease of development and low cost to the developer. True or False?

Q6. An MCU-based network is most comparable with a:

  1. Torrent network

  2. Star network mesh

  3. Full network mesh

  4. Partial mesh network

Summary


By now, your head should be filled with dreams of the amazing things that WebRTC can do. We covered a large list of advanced techniques that can be used to greatly enhance the usability and performance of your application. Each of these topics has a wealth of information to read about and also discover on your own. It would be a great idea to spend time researching each one at your leisure if you plan on continuing your WebRTC education!

All these topics are aimed at learning how to release a large-scale WebRTC application. When learning how to use WebRTC, developers may not think about what happens when you go from two users to two hundred or two thousand users at a time. There can be a lot of growing pains if you are not prepared for what may happen when adding more users to your application. The best way to learn is to keep experimenting with the techniques presented here and pick and choose what your most immediate needs are.

The examples that we built upon are a great way to jump...

lock icon The rest of the chapter is locked
You have been reading a chapter from
Learning WebRTC
Published in: Jun 2015 Publisher: ISBN-13: 9781783983667
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}