All Projects β†’ paullouisageneau β†’ Libdatachannel

paullouisageneau / Libdatachannel

Licence: lgpl-2.1
C/C++ WebRTC Data Channels and Media Transport standalone library

Programming Languages

cpp
1120 projects

Projects that are alternatives of or similar to Libdatachannel

Camus
Peer-to-peer group video chat using WebRTC, Python, and Javascript
Stars: ✭ 75 (-77.68%)
Mutual labels:  webrtc, p2p, peer-to-peer
P2p Cdn Sdk Javascript
Free p2p cdn github javascript sdk to reduce video streaming costs of live and on demand video using webrtc by upto 90% and improve scalability by 6x - πŸš€ Vadootv πŸš€
Stars: ✭ 158 (-52.98%)
Mutual labels:  webrtc, p2p, peer-to-peer
Peer Calls
Group peer to peer video calls for everyone written in Go and TypeScript
Stars: ✭ 837 (+149.11%)
Mutual labels:  webrtc, p2p, peer-to-peer
Pikachu Volleyball P2p Online
Pikachu Volleyball peer-to-peer online via WebRTC data channels
Stars: ✭ 160 (-52.38%)
Mutual labels:  webrtc, p2p, peer-to-peer
Laverna
Laverna is a JavaScript note taking application with Markdown editor and encryption support. Consider it like open source alternative to Evernote.
Stars: ✭ 8,770 (+2510.12%)
Mutual labels:  websocket, webrtc, peer-to-peer
Metastream
Watch streaming media with friends.
Stars: ✭ 1,926 (+473.21%)
Mutual labels:  websocket, webrtc, p2p
Wt Tracker
High-performance WebTorrent tracker
Stars: ✭ 144 (-57.14%)
Mutual labels:  webrtc, p2p, peer-to-peer
Ca11
Multi-Protocol Webphone
Stars: ✭ 69 (-79.46%)
Mutual labels:  websocket, webrtc, p2p
Laplace
Laplace is an open-source project to enable screen sharing directly via browser. Based on WebRTC for low latency peer-to-peer connections, and WebSocket implemented in golang for signaling.
Stars: ✭ 81 (-75.89%)
Mutual labels:  websocket, webrtc, peer-to-peer
Airdcpp Webclient
Communal peer-to-peer file sharing application for file servers/NAS devices
Stars: ✭ 106 (-68.45%)
Mutual labels:  websocket, p2p, peer-to-peer
Ayame
WebRTC Signaling Server Ayame
Stars: ✭ 218 (-35.12%)
Mutual labels:  websocket, webrtc, p2p
Diffy
πŸŽžοΈπŸ’“πŸΏ Love streaming - It's always best to watch a movie together ! πŸ€—
Stars: ✭ 37 (-88.99%)
Mutual labels:  webrtc, p2p
udpeer
A simple UDP peer to peer networking proxy using webrtc
Stars: ✭ 19 (-94.35%)
Mutual labels:  webrtc, p2p
nicotine-plus
Graphical client for the Soulseek peer-to-peer network
Stars: ✭ 601 (+78.87%)
Mutual labels:  peer-to-peer, p2p
peermesh
πŸ’« Exchange files p2p and e2e encrypted over a fully meshed network in your browser using WebRTC.
Stars: ✭ 107 (-68.15%)
Mutual labels:  webrtc, p2p
P2P-CKPlayer
塌ε…₯P2PεΌ•ζ“Žηš„CKPlayerοΌŒθ§†ι’‘η½‘η«™ηœζ΅ι‡&εŠ ι€Ÿη₯žε™¨
Stars: ✭ 49 (-85.42%)
Mutual labels:  webrtc, p2p
rtc-ssh
WebRTC wrapper for SSH connect
Stars: ✭ 95 (-71.73%)
Mutual labels:  webrtc, p2p
go-ayame
go-ayame is go client library for WebRTC Signaling Server Ayame
Stars: ✭ 20 (-94.05%)
Mutual labels:  webrtc, p2p
Biubiu
εΌΉεΉ•θ§†ι’‘δΈŽη›΄ζ’­η½‘η«™
Stars: ✭ 266 (-20.83%)
Mutual labels:  websocket, webrtc
Zlmediakit
WebRTC/RTSP/RTMP/HTTP/HLS/HTTP-FLV/WebSocket-FLV/HTTP-TS/HTTP-fMP4/WebSocket-TS/WebSocket-fMP4/GB28181 server and client framework based on C++11
Stars: ✭ 5,248 (+1461.9%)
Mutual labels:  websocket, webrtc

libdatachannel - C/C++ WebRTC Data Channels

libdatachannel is a standalone implementation of WebRTC Data Channels, WebRTC Media Transport, and WebSockets in C++17 with C bindings for POSIX platforms (including GNU/Linux, Android, and Apple macOS) and Microsoft Windows. It enables direct connectivity between native applications and web browsers without the pain of importing the entire WebRTC stack. The interface consists of simplified versions of the JavaScript WebRTC and WebSocket APIs present in browsers, in order to ease the design of cross-environment applications. It can be compiled with multiple backends:

  • The security layer can be provided through OpenSSL or GnuTLS.
  • The connectivity for WebRTC can be provided through my ad-hoc ICE library libjuice as submodule or through libnice.

Licensed under LGPLv2, see LICENSE.

Compatibility

The library implements the following communication protocols:

WebRTC Data Channels and Media Transport

The WebRTC stack has been tested to be compatible with Firefox and Chromium.

Protocol stack:

Features:

Note only SDP BUNDLE mode is supported for media multiplexing (draft-ietf-mmusic-sdp-bundle-negotiation-54). The behavior is equivalent to the JSEP bundle-only policy: the library always negociates one unique network component, where SRTP media streams are multiplexed with SRTCP control packets (RFC5761) and SCTP/DTLS data traffic (RFC5764).

WebSocket

WebSocket is the protocol of choice for WebRTC signaling. The support is optional and can be disabled at compile time.

Protocol stack:

  • WebSocket protocol (RFC6455), client-side only
  • HTTP over TLS (RFC2818)

Features:

  • IPv6 and IPv4/IPv6 dual-stack support
  • Keepalive with ping/pong

Dependencies

Only GnuTLS or OpenSSL are necessary.

Optionally, libnice can be selected as an alternative ICE backend instead of libjuice.

Submodules:

Building

See BUILDING.md for building instructions.

Examples

See examples for complete usage examples with signaling server (under GPLv2).

Additionnaly, you might want to have a look at the C API documentation.

Signal a PeerConnection

#include "rtc/rtc.hpp"
rtc::Configuration config;
config.iceServers.emplace_back("mystunserver.org:3478");

rtc::PeerConection pc(config);

pc.onLocalDescription([](rtc::Description sdp) {
    // Send the SDP to the remote peer
    MY_SEND_DESCRIPTION_TO_REMOTE(string(sdp));
});

pc.onLocalCandidate([](rtc::Candidate candidate) {
    // Send the candidate to the remote peer
    MY_SEND_CANDIDATE_TO_REMOTE(candidate.candidate(), candidate.mid());
});

MY_ON_RECV_DESCRIPTION_FROM_REMOTE([&pc](string sdp) {
    pc.setRemoteDescription(rtc::Description(sdp));
});

MY_ON_RECV_CANDIDATE_FROM_REMOTE([&pc](string candidate, string mid) {
    pc.addRemoteCandidate(rtc::Candidate(candidate, mid));
});

Observe the PeerConnection state

pc.onStateChange([](PeerConnection::State state) {
    cout << "State: " << state << endl;
});

pc.onGatheringStateChange([](PeerConnection::GatheringState state) {
    cout << "Gathering state: " << state << endl;
});

Create a DataChannel

auto dc = pc.createDataChannel("test");

dc->onOpen([]() {
    cout << "Open" << endl;
});

dc->onMessage([](variant<binary, string> message) {
    if (holds_alternative<string>(message)) {
        cout << "Received: " << get<string>(message) << endl;
    }
});

Receive a DataChannel

shared_ptr<rtc::DataChannel> dc;
pc.onDataChannel([&dc](shared_ptr<rtc::DataChannel> incoming) {
    dc = incoming;
    dc->send("Hello world!");
});

Open a WebSocket

rtc::WebSocket ws;

ws.onOpen([]() {
	cout << "WebSocket open" << endl;
});

ws.onMessage([](variant<binary, string> message) {
    if (holds_alternative<string>(message)) {
        cout << "WebSocket received: " << get<string>(message) << endl;
    }
});

ws.open("wss://my.websocket/service");

External resources

Thanks

Thanks to Streamr for sponsoring this work!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].