K-ary trees of RTCDataChannel connected nodes.
Scalable broadcasting for streams of live data.
- SimplePeer for representing peer node
RTCDataChannel
connections. - Firebase for
RTCPeerConnection
signaling.
$ npm run example
$ npm run test
There aren't any real tests yet (coming soon though!), for now this just runs standard.
var fireflower = require('fireflower')
var node = fireflower('tree-signals-url.firebaseio.com' [, opts])
Where opts
can be:
{
id: '0', // string, optional
root: true, // boolean, optional, indicates that you want to be the root node
reportInterval: 5000, // int, optional, generate perodic status reports
peerConfig: { // object, optional, standard RTCPeerConnection constructor options
iceServers: [
{
url: 'stun:23.21.150.121'
}, {
url: 'turn:global.turn.twilio.com:1234?transport=udp',
username: 'xxx',
credential: 'yyy'
}
]
},
channelConfig: { // object, optional, standard RTCDataChannel properties
ordered: true,
maxRetransmits: 3,
maxPacketLifeTime: 500
}
}
Publish a request to join the tree. If disconnected, instances will republish their request to join.
Disconnect and / or halt any attempts to reconnect.
An upstream node has responded to the instance's request to join the tree and has established an RTCDataChannel
connection.
Connection to upstream node was lost.
Response to a connection request was accepted and a downstream node was connected.
The connection to a downstream node was lost.
Configuration data was read for the first time or updated.
A configuration error occurred.
Just a prototype for the moment!
MIT