Introducing the Data API
The WebRTC Data API introduces the RTCDataChannel entity, which enables direct data connections between peers (just like for audio and video media channels), as we learned in Chapter 1, Developing a WebRTC Application.
Used in pair with RTCPeerConnection and utilizing the ICE framework, it makes it possible to link up direct data connections through firewalls and NATs. The Data API can be used to build powerful, low-latency applications such as games, remote desktops, desktop sharing, real-time private text chats, peer-to-peer file sharing, and torrents.
Data channels in WebRTC have built-in security. They are usually even faster than WebSocket connections (browser-to-server), because connections proceed between browsers without any point in the middle. Nevertheless, if you turn on the server, data will be transmitted via the server (consuming additional bandwidth on the server side). Also, connection establishment using data channels takes longer than when using...