libdatachannel

libdatachannel is an open-source software library implementing WebRTC Data Channels, WebRTC Media Transport, and WebSockets. It is written in C++17 and offers C bindings. The source code is available under MPL 2.0, and the library is on AUR, Vcpkg, and FreeBSD Ports.

Easy

  • Simple API inspired by the JavaScript API including WebSocket for signaling
  • Minimal external dependencies (only OpenSSL or GnuTLS)
  • Lightweight and way easier to compile and use than Google's reference library

Compatible

  • Compatible with browsers Firefox, Chromium, and Safari, and other WebRTC libraries (see webrtc-echoes)
  • Licensed under MPL 2.0, meaning software with any license may use the library
  • Community-maintained bindings available for Rust, Node.js, and Unity

Portable

  • Support for POSIX platforms (including GNU/Linux, Android, FreeBSD, Apple macOS and iOS) and Microsoft Windows
  • Support for GnuTLS, Mbed TLS, or OpenSSL as TLS backend
  • Code using Data Channels and WebSockets may be compiled as-is to WebAssembly for browsers with datachannel-wasm