simple-datachannel
Simple WebRTC data channels.
features
- simple-peer like
- can make multi data-channels for a peer
install
npm install simple-datachannel
usage
For example manual signaling and send message each other through multi data-channels.
;const peerOffer = ;const peerAnswer = ; peerOffer; peerOfferev; peerOfferev; peerAnswerev;
events
ev.on('signal', function (data) {})
Fired when the peer wants to send signaling data to the remote peer.
peer.on('connect', function () {})
Fired when the peer connection and data channel are ready to use.
peer.on('disconnect', function () {})
Fired when the peer connection and data channel disconnected.
peer.on('data', function (data) {})
Received a message from the remote peer (via the data channel).
data
will be either a String
or a Buffer/Uint8Array
license
MIT. Copyright (c) shinyoshiaki.