Work is moving on fast on our WebRTC gateway Janus. Just these latest weeks, besides improving the overall architecture and performances, we added several features that we were interested in supporting, like RTCP muxing, bundling, Trickle ICE and more.

One of the most interesting new features provided by WebRTC, though, are Data Channels, a way to allow WebRTC users to exchange real-time data other than audio and video in a peer-to-peer fashion. So far, Janus didn’t support them yet. And I mean so far because, as you might have guessed by the enthusiastic and self-revealing post title, we finally implemented support for Data Channels as well! This was made possible thanks to the help of the excellent usrsctp library, which allows for user space usage of SCTP, and was already used for Data Channels by both Chrome and Firefox.

Data Channels in Janus are a really exciting opportunity. The image below shows a first example of the new Data Channel integration within the Echo Test plugin demo:

Data Channels in the Janus EchoTest demo

Data Channels in the Janus EchoTest demo

The EchoTest plugin does a very simple manipulation: whenever it receives a string through a Data Channel, it builds a new one that integrates it, and returns it to the user as it does for audio and video frames. Of course this is a very trivial and silly usage of Data Channels, but it indeed proves that data is available and that it can be messed with. Integrating this in other plugins (e.g., to provide real-time chat features to a video call or conference) or writing new plugins from scratch that take explicit advantage of this functionality would be just as easy. If you consider that you can reflect the same Data Channel message to several different users at the same time, you can understand why we’re so excited!

That said, at the time of writing this new feature has not been pushed to GitHub yet. We’ve just finished integrating SCTP and DataChannels within the Janus core and, since it took some changes here and there, we want to make sure nothing else broke in the process! This won’t take more than a few days, though, so if you’re as excited as we are about it, stay tuned and get ready to play with it!

I'm getting older but, unlike whisky, I'm not getting any better