Common WebRTC mistakes and how to avoid
them
Tsahi Levent-Levi
Tsahi Levent-Levi
• Consultant and analyst in digital communications
• Focus on WebRTC, CPaaS (and recently also
ML/AI)
• Co-founder and CEO of testRTC
BlogGeek.me
In this session
• A bit about WebRTC
• A shopping list of common mistakes…
A bit about WebRTC
WebRTC offers real time communication
natively from a web browser
WebRTC is a media engine with JavaScript
APIs
WebRTC is a Technology
not a Solution
How are calls made in WebRTC?
1
2
3
4
5
The usual
stuff
15% (?) of
sessions
The usual
stuff
15% (?) of
sessions
The usual
stuff
Concurrency
& scaling out
15% (?) of
sessions
The usual
stuff
Concurrency
& scaling out
Throughput
At an intersection of worlds
Our
Internet
Web
Traditional
VoIP
1Mis-configuring NAT traversal
DON’T use STUN servers lists
MORE IS LESS
DON’T use public STUN servers
DON’T use “public” TURN servers
[
"turn:<HOSTNAME>:<PORT>?transport=udp", // UDP
"turn:<HOSTNAME>:<PORT>?transport=tcp // TCP
];
[
"turn:<HOSTNAME>:<PORT>?transport=udp", // UDP
"turn:<HOSTNAME>:<PORT>?transport=tcp", // TCP
"turns:<HOSTNAME>:<PORT>?transport=tcp" // TLS
];
[
"turn:<HOSTNAME>:443?transport=udp", // UDP
"turn:<HOSTNAME>:443?transport=tcp", // TCP
"turns:<HOSTNAME>:443?transport=tcp" // TLS
];
What else?
• Globally deploy your TURN servers
• Add ephemeral passwords for TURN sessions
• Test that the configuration actually works
• Monitor behavior over time
2Selecting the WRONG signaling framework
No really good, popular github signaling project for WebRTC
• Lots of projects, but no well maintained ones
• Google’s AppRTC is usually unsuitable
peerjs
https://peerjs.com/
EasyRTC
http://easyrtc.com/
Muaz Khan WebRTC Experiment
https://www.webrtc-experiment.com/
3Testing locally
DON’T test locally
10.0.0.1 10.0.0.2
80.246.130.243
DON’T test locally
10.0.0.1 10.0.0.1
176.231.82.46
Things to consider
• Different regions around the globe
• Network conditions
• Firewall configurations
• Operating systems and browser versions
• …
4Ignoring (or forgetting) security
WebRTC is secure
• Media
• Only on SRTP
• Which is encrypted
• Keys exchanged over DTLS
• Signaling
• Web apps forced to use HTTPS (or WSS)
You have a role to play in security
• Application logic and signaling
• TURN server access
• Media server resources
• Keeping up with WebRTC releases
• …
5Not collecting stats and traces
It isn’t always in your control
• Access to network (landline, WiFi, cellular, …)
• # of devices on local network (and what they are doing)
• Automatic browser upgrades
People will still assume you are to blame
Be sure you can analyze issues
• Log at the edge (from devices)
• Collect whatever you can
• Have the means to analyze it. Visually
• Look at https://github.com/lifeonairteam/rtcstats
6Thinking short term
New browser version
Every
6-8weeks
WebRTC 1.0
WebRTC NV
Design Implement Maintain
7Failing to understand WebRTC
webrtccourse.com
20% discount
with coupon code RTCEXPO2019
until Oct 31

Common WebRTC mistakesand how to avoid them (RTC Expo 2019)