webrtc VS libdatachannel

Compare webrtc vs libdatachannel and see what are their differences.


A pure Rust implementation of WebRTC (by webrtc-rs)
Our great sponsors
  • Zigi - Delete the most useless function ever: context switching.
  • SonarQube - Static code analysis for 29 languages.
  • InfluxDB - Build time-series-based applications quickly and at scale.
  • Scout APM - Truly a developer’s best friend
webrtc libdatachannel
27 15
2,439 944
4.3% -
8.2 9.3
4 days ago 2 days ago
Rust C++
Apache License 2.0 GNU Lesser General Public License v3.0 only
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.


Posts with mentions or reviews of webrtc. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-11-27.
  • WebRTC 102: Understanding libWebrtc
    4 projects | dev.to | 27 Nov 2022
    The "Mediasoup" project provides a high level JavaScript/TypeScript interface to the WebRTC APIs. The core logic of this project is implemented in C++/Rust. Consider taking a look at the project if you want an easy-to-use library instead of the low-level libWebRTC APIs. A notable project to mention is the Pion/webrtc project which has a Golang implementation of the WebRTC API. Of course, we should mention the rust port WebRTC.rs. Let’s keep all the rustaceans happy too!
  • I built a Zoom clone 100% IN RUST
    12 projects | reddit.com/r/rust | 24 Oct 2022
    Have you considered using webrtc? It's a well-established protocol supported by all major browsers, and there's already a pure-Rust implementation you might be able to use.
    12 projects | reddit.com/r/rust | 24 Oct 2022
    If you ever did decide to add the complexity of RTC, my personal favorite SFU is MediaSoup with Janus a second. But if you want to be adventurous the Rust WebRTC project would be your go to. In any case cool project!!
  • Best way to implement one directional listener for UDP or TCP?
    2 projects | reddit.com/r/rust | 6 Oct 2022
    Yup, WebRTC can do this. In Rust there's webrtc.rs which I've been contributing a fair amount to. Check out this example the SDP that's provided via $BROWSER_SDP and the subsequent answer that is pasted back into jsfiddle is the two way connection that /u/anlumo mentioned. With a server this is typically done with a POST request.
  • Announcing webrtc 0.5.0
    4 projects | reddit.com/r/rust | 7 Sep 2022
    They are fully implemented and work. There's a known performance issue related to peak throughput, which trails Pion significantly. There might be bugs of course, but we haven't found any data channel bugs for our use case(SFU).
    4 projects | reddit.com/r/rust | 7 Sep 2022
    While there's still more work to do, there are many examples available to showcase what the project can do already.
  • No really, why can't we have raw UDP in JavaScript?
    2 projects | reddit.com/r/javascript | 6 Jul 2022
    There are implementations for that, here is one for example.
  • STUNner: A Kubernetes ingress gateway for WebRTC
    8 projects | news.ycombinator.com | 22 May 2022
  • LiveKit – open-source, high performance WebRTC infrastructure
    5 projects | news.ycombinator.com | 20 May 2022
    I think https://webrtc.rs/ is our best bet for this future. I am very optimistic about it. The security/memory safety aspect of it is just so important.

    So many important things are happening over WebRTC (telemedicine, remote control of dangerous machines...) I just would hate to see one of these C++ memory bugs have a negative impact.

  • Rust Time Communication.
    3 projects | dev.to | 4 May 2022
    With the strike in session, I had a lot of time on my hands to learn what I needed to learn, and things went on smoothly till I hit a brick wall. I couldn’t find a Web RTC implementation in Rust. Web RTC is a framework that allows browsers and web-based applications to communicate in real-time. It is important to know that while Rust has made a lot of waves in recent times, it is still relatively new compared to other languages and development technology. There were still things that had not fully been abstracted to the level where regular developers could easily access the functionalities without having a deep understanding of how they worked. Web RTC was one of them. Now that I think of it, I found one, but it was basically just C embedded in Rust. While that sort of worked, It wasn’t what I wanted. I searched around a bit more, then I found someone, Rainliu working on a Web RTC implementation in Rust. It was in its early stages though, in fact, all that had been done was a collated list of frameworks that would allow Web RTC to work in Rust. I decided to help out, or at least try to help. There I was, a few weeks into learning Rust, and I wanted to help build a library.


Posts with mentions or reviews of libdatachannel. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-08-21.
  • Who uses node executable without using npm?
    7 projects | reddit.com/r/node | 21 Aug 2022
    Node.js node JavaScript runtime itself provides a means to interface with native applications. Plenty of people write their own WebSocket or WebRTC data channel libraries https://github.com/paullouisageneau/libdatachannel.
  • Is it just me, or is it much easier to make complicated applications in C++ than web?
    3 projects | reddit.com/r/webdev | 14 Aug 2022
    Fourtunately some technologies and API's are extensible enough to do whatever you want in spite of and to overcome limitations; e.g., WebRTC (particularly data channels https://github.com/paullouisageneau/libdatachannel), Native Messaging, WebTransport, fetch(), Trasnferable Streams, Media Capture Transform, File API, File System Access API, Web extensions.
  • How are rust devs doing?
    10 projects | reddit.com/r/GraphicsProgramming | 17 Jul 2022
    To be fair, C++ has libdatachannel which I like using too.
  • Transport agnostic Websocket library
    6 projects | reddit.com/r/cpp | 14 Jul 2022
    https://github.com/paullouisageneau/libdatachannel ?
  • No why can't we have raw UDP in JavaScript?
    2 projects | news.ycombinator.com | 5 Jul 2022
    Or use something specific like libdatachannel https://libdatachannel.org/

    If you’re using WebRTC data channels in a client server config then infra is no more complex than a regular setup because the server will almost certainly have an external facing IP address.

    People should really try using WebRTC as well because you can get the full pipeline setup for a toy demo in a couple of slow days. I did whilst also writing my own signalling server in Go without having used Go before!

    It’s certainly not any more complex than rolling all the stuff the article is talking about on top of raw UDP.

  • Show HN: MockRTC – a mock peer and MitM proxy library for WebRTC
    2 projects | news.ycombinator.com | 5 May 2022
    This does use a real WebRTC stack (specifically libdatachannel - https://libdatachannel.org). Under the hood this is making real WebRTC connections.

    But I guess you mean why it doesn't mock using real peers in the browser where the tests are happening, using the browser's existing stack there?

    There's a few reasons I've avoided that:

    * Primarily: I want to do things that the browser APIs won't let you do. E.g. sending invalid data, or intentionally causing various types of errors. The browser APIs are designed to stop you doing the wrong thing, by keeping the raw data at arm's length. Very sensible for normal WebRTC usage, but bad for testing edge cases and breaking things.

  • FFmpeg - correct configuration for building webRTC in native C++?
    3 projects | reddit.com/r/WebRTC | 3 May 2022
    Building WebRTC tends to be hell. If your use case is simple enough, it might be interesting to switch to an alternative C++ library like libdatachannel (I'm the author).
  • What are the differences between UDP and WebSockets, and which type of games benefit from which?
    2 projects | reddit.com/r/gamedev | 2 May 2022
    You can, in theory, get UDP-like characteristics out of a different web API - with a WebRTC datachannel configured to be unreliable and unordered. I haven't seen anybody use that API just because it's a pretty big pain to use. The developer of Agar IO called it too hard to use in a HackerNews comment, but nowadays there's simpler libraries than the ones he had in 2016 like webrtc-unreliable and libdatachannel. You still need to run a STUN/TURN server and the integration is easier than it was back then, but still much harder than raw UDP sockets though.
  • string to const char* for popen()
    6 projects | reddit.com/r/cpp_questions | 21 Feb 2022
    exit(EXIT_SUCCESS); } char message[message_length]; fread(message, message_length, sizeof(char), stdin); string m(message, message + sizeof message / sizeof message[0]); return json::parse(m); } // Encode a message for transmission, given its content. message_t encode_message(json content) { string encoded_content = content.dump(); message_t m; m.content = encoded_content; m.length = (uint32_t)encoded_content.length(); return m; } // Send an encoded message to stdout. void send_message(message_t encoded_message) { char *raw_length = reinterpret_cast(&encoded_message.length); fwrite(raw_length, 4, sizeof(char), stdout); fwrite(encoded_message.content.c_str(), encoded_message.length, sizeof(char), stdout); fflush(stdout); } int main(int argc, char *argv[]) { while (true) { json message = get_message(); auto command = message.get(); // https://github.com/paullouisageneau/libdatachannel/issues/544#issuecomment-1024739214 // https://www.reddit.com/r/cpp\_questions/comments/swr1tk/comment/hxral9f/ FILE *pipe = popen(command.c_str(), "r"); while (true) { size_t bufferSize = 1024; byte buffer[bufferSize]; size_t count; while ((count = fread(buffer, 1, bufferSize, pipe)) > 0) { stringstream data; // S16NE PCM from parec to integers in JSON array data << "["; for (size_t i = 0; i < count; i++) { data << (int)buffer[i]; if (i < count - 1) { data << ","; } } data << "]"; // send JSON array to Native Messaging local client send_message(encode_message(data.str())); } } } }
  • Libwebsockets a powerful and lightweight pure C library
    7 projects | news.ycombinator.com | 6 Sep 2021

What are some alternatives?

When comparing webrtc and libdatachannel you can also consider the following projects:

libjuice - JUICE is a UDP Interactive Connectivity Establishment library

Pion WebRTC - Pure Go implementation of the WebRTC API

aiortc - WebRTC and ORTC implementation for Python using asyncio

sora-unity-sdk - WebRTC SFU Sora Unity SDK

janus-gateway - Janus WebRTC Server

µWebSockets - Simple, secure & standards compliant web server for the most demanding of applications

tiny-webrtc-gw - tiny/fast webRTC video conferencing gateway

SIPSorcery - A WebRTC, SIP and VoIP library for C# and .NET. Designed for real-time communications apps.

openmiko - Open source firmware for Ingenic T20 based devices such as WyzeCam V2, Xiaomi Xiaofang 1S, iSmartAlarm's Spot+ and others.

tauri - Build smaller, faster, and more secure desktop applications with a web frontend.