All Projects → murat-dogan → node-datachannel

murat-dogan / node-datachannel

Licence: other
Easy to use WebRTC data channels and media transport. libdatachannel node bindings.

Programming Languages

C++
36643 projects - #6 most used programming language
javascript
184084 projects - #8 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to node-datachannel

datachannel-wasm
C++ WebRTC Data Channels and WebSockets for WebAssembly in browsers
Stars: ✭ 77 (-42.96%)
Mutual labels:  peer-to-peer, datachannel, libdatachannel
focuspoint
Erweitert den Medienpool um die Fähigkeit, den Fokuspunkt eines Bildes zu bestimmen.
Stars: ✭ 57 (-57.78%)
Mutual labels:  media
BinaryStream
BinaryStream - a writer and reader for binary data. Best replacement for pack()/unpack().
Stars: ✭ 44 (-67.41%)
Mutual labels:  media
Mp3Info
The fastest PHP library to extract mp3 meta information (duration, bitrate, samplerate and so on) and tags (id3v1, id3v2).
Stars: ✭ 114 (-15.56%)
Mutual labels:  media
fabric
Fabric is an experimental protocol for exchanging information.
Stars: ✭ 46 (-65.93%)
Mutual labels:  peer-to-peer
airdrop
Relp ✨ A web messenger. Enjoy free text chat, voice call and file sharing ✔
Stars: ✭ 46 (-65.93%)
Mutual labels:  peer-to-peer
utopia-crm
Utopía is an open source platform for community based newsrooms to manage their subscriptions
Stars: ✭ 15 (-88.89%)
Mutual labels:  media
nvim
Repository for the Tandem NeoVim Plugin
Stars: ✭ 23 (-82.96%)
Mutual labels:  peer-to-peer
Rise-Media-Player
One media player for everything you own or stream; whether it's music or videos, online or offline Rise Media Player does it all. And it's beautiful and native with the latest version of WinUI.
Stars: ✭ 600 (+344.44%)
Mutual labels:  media
speke-reference-server
Secure Packager and Encoder Key Exchange (SPEKE) is part of the AWS Elemental content encryption protection strategy for media services customers. SPEKE defines the standard for communication between our media services and digital rights management (DRM) system key servers. This project provides the basic framework that partners can specialize a…
Stars: ✭ 91 (-32.59%)
Mutual labels:  media
WiFi-Direct-File-Transfer-App
WiFi Direct File Transfer is a experimental app that will allow sharing of data between Android devices running Android 4.0 or higher using a WiFi direct connection without the use of a WiFi access point. This will enable data transfer between devices without relying on any existing network infrastructure
Stars: ✭ 88 (-34.81%)
Mutual labels:  peer-to-peer
haveno
Decentralized P2P exchange built on Monero and Tor
Stars: ✭ 542 (+301.48%)
Mutual labels:  peer-to-peer
ipfs-chat
Real-time P2P messenger using go-ipfs pubsub. TUI. End-to-end encrypted texting & file-sharing. NAT traversal.
Stars: ✭ 84 (-37.78%)
Mutual labels:  peer-to-peer
server-media
This repository collects icons, logos & information about game servers.
Stars: ✭ 29 (-78.52%)
Mutual labels:  media
thunder-distribution
A Drupal-based platform for professional publishers
Stars: ✭ 31 (-77.04%)
Mutual labels:  media
media-player
An modern, clean media player built using web technologies
Stars: ✭ 44 (-67.41%)
Mutual labels:  media
datachannel-rs
Rust wrappers for libdatachannel
Stars: ✭ 88 (-34.81%)
Mutual labels:  datachannel
webrtc-p2p-datachannel
webrtc p2p视频聊天,使用datachannel发送文本消息
Stars: ✭ 33 (-75.56%)
Mutual labels:  datachannel
meteor-video-chat
Simple id based video calling in meteor
Stars: ✭ 33 (-75.56%)
Mutual labels:  peer-to-peer
lk
Simple Web Image Viewer
Stars: ✭ 22 (-83.7%)
Mutual labels:  media

Easy to use WebRTC data channels and media transport

Build CI

  • Easy to use
  • Lightweight
    • No need to deal with WebRTC stack!
    • Small binary sizes
  • Type infos for Typescript

This project is NodeJS bindings for libdatachannel library.

Please check libdatachannel for Compatibility & WebRTC details.

Install

npm install node-datachannel

Supported Platforms

Linux-x64 Linux-armv7 Linux-arm64(1) Windows-x86 Windows-x64 Mac
Node V10 + + + + + +
Node V11 + + + + + +
Node V12 + + + + + +
Node V13 + + + + + +
Node V14 + + + + + +
Node V15 + + + + + +
Node V16 + + + + + +
Node V17 + + + + + +
  1. Please note that; For arm64 platform we need OpenSSL to be installed locally.

Example Usage

const nodeDataChannel = require('node-datachannel');

// Log Level
nodeDataChannel.initLogger("Debug");

let dc1 = null;
let dc2 = null;

let peer1 = new nodeDataChannel.PeerConnection("Peer1", { iceServers: ["stun:stun.l.google.com:19302"] });

// Set Callbacks
peer1.onLocalDescription((sdp, type) => {
    console.log("Peer1 SDP:", sdp, " Type:", type);
    peer2.setRemoteDescription(sdp, type);
});
peer1.onLocalCandidate((candidate, mid) => {
    console.log("Peer1 Candidate:", candidate);
    peer2.addRemoteCandidate(candidate, mid);
});

let peer2 = new nodeDataChannel.PeerConnection("Peer2", { iceServers: ["stun:stun.l.google.com:19302"] });

// Set Callbacks
peer2.onLocalDescription((sdp, type) => {
    console.log("Peer2 SDP:", sdp, " Type:", type);
    peer1.setRemoteDescription(sdp, type);
});
peer2.onLocalCandidate((candidate, mid) => {
    console.log("Peer2 Candidate:", candidate);
    peer1.addRemoteCandidate(candidate, mid);
});
peer2.onDataChannel((dc) => {
    console.log("Peer2 Got DataChannel: ", dc.getLabel());
    dc2 = dc;
    dc2.onMessage((msg) => {
        console.log('Peer2 Received Msg:', msg);
    });
    dc2.sendMessage("Hello From Peer2");
});

dc1 = peer1.createDataChannel("test");

dc1.onOpen(() => {
    dc1.sendMessage("Hello from Peer1");
});

dc1.onMessage((msg) => {
    console.log('Peer1 Received Msg:', msg);
});

setTimeout(() => {
    dc1.close();
    dc2.close();
    peer1.close();
    peer2.close();
    nodeDataChannel.cleanup();
}, 10 * 1000);

Test

npm run test                  # Unit tests
node test/connectivity.js     # Connectivity

Build

Please check here

Examples

Please check examples folder

API Docs

Please check docs page

Thanks

Thanks to Streamr for supporting this project by being a Sponsor!

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].