Developing for a successful product
http://slides.com/noehlman/pragmatic-webrtc/live
Not a cool WebRTC technology demonstration
A quick (and incomplete!) primer on some of the things
you might want to know before making a WebRTC product.
"Is WebRTC actually the right technology to use?"
Before jumping in, ask yourself...
WebRTC is one of the fancy new technologies of the web, with great potential.. however it is definitely not a "one size fits all" technology
Additionally, P2P architecture can greatly increase complexity, and potentially reduce scalability, reliability and security.
Can make for a challenging business model as well!
Not a necessity, but certainly recommended.
Some General Framework/SDK options... (not definitive)
MCU/SFUs
STUN/TURN
The backbone of any WebRTC application.
Can be any mechanism for identifying peers, exchanging session descriptions about a peer connection between peers, and setting up the connection.
Some frameworks include signalling implementations.
Important!
P2P !== implicitly secure
One of the big marketing points of WebRTC is that data no longer has to touch a server, but that doesn't mean it's protected.
A number of aspects:
Standard stuff - making sure nobody is snooping on your packets!
For peer connections, WebRTC enforces encryption as a mandatory feature. Chrome and Firefox use DTLS-SRTP to achieve this.
TURN (relay servers) are OK too - end-to-end encryption.
No such guarantee for signalling - application developers responsibility!
Making sure that only authorised P2P connections are established
Data not touching a central server doesn't matter, if your application allows an unauthorised peer to access that data.
If necessary, monitor calls for unauthorised participants.
In a P2P architecture, peers assume a lot more of the responsibility for their own security.
Primarily, verifying the identity of their peers.
This may appear to be solved by signalling, but signalling servers may not/ always be able to be trusted.
Allowing independent authentication by peers against a separate Identity Provider service can help solve this (with appropriate transport security).
Recently, WebRTC has received significant negative publicity around a few issues:
IP Leakage
Websites can use WebRTC to identify the IP addresses of the local computer, leading to privacy concerns around tracking and identification.
Network scanning
In conjunction with WebSockets, can also be used to scan networks exposed on the local computer for active hosts.
If there's one thing that web applications (and web application developers) struggle with, it's having an appropriate suite of automated tests.
Web applications have been notoriously difficult to automate testing for:
Modular development helps contribute to small, easily unit testable code.
Module Bundler + Test Framework + Cross Browser Test Runner
=
Testable Code
Two main contenders at this time in the world of Javascript:
Both have lots of things going for them!
A few options...
Smokestack (https://www.npmjs.com/package/smokestack)
- Chrome + Firefox locally + SauceLabs for everything else
Zuul (https://www.npmjs.com/package/zuul)
- Local testing (via URL) + SauceLabs for remote
Broth (https://github.com/DamonOehlman/broth)
+ Travis MultiRunner (https://github.com/DamonOehlman/travis-multirunner)
- Local Testing + Chrome/Firefox on Travis CI
Testling (https://github.com/substack/testling) (endangered)
Monitoring the health of WebRTC connections forms a crucial part of helping to detect and resolve issues.
Lots of moving parts in a WebRTC application, and therefore lots of things that can go wrong.
Signalling/web servers
No problems, traditional monitoring
WebRTC connections
Requires a little more work to report on connection and quality issues.
Generally an agent on the peer that sends QoS reports back to a server providing the peers perspective of the connection.
Primarily sourced from application, signaller and the getStats API
Not a large number of options...
Callstats.io (http://www.callstats.io/)
TestRTC (http://testrtc.com/) (in closed beta)
NICTA's monitoring platform (not publicly available, but we can talk...)
WebRTC is hard... things will break!
WebRTC uses the ICE framework, together with the STUN and TURN to enable network traversal, and eliminate a lot of the difficulties in establishing a connection, but it's not perfect.
Few things to note:
Covers a range of potential problems, and is one of the primary contributors to customer dissatisfaction.
Some could be related to users...
While it may seem obvious to use as developers, applications dealing with video/audio should help users identify problems like these.
Some issues are environmental/technical:
To get around these limitations can result in difficult/no-win choices, such as:
Most P2P applications will want to exchange data in some form, often in the form of a replicated, distributed state across peers, often over WebRTC data channels.
Requires careful architecture of the replication systems to support appropriate concurrency and robustness, such as the use of a gossip protocol.
Some handy starting points:
WebRTC Specification
Discuss WebRTC Group
https://groups.google.com/forum/#!forum/discuss-webrtc
WebRTC Experiments
https://www.webrtc-experiment.com/
AppRTC (a reference application)