0.0.5 • Published 10 years ago

simple-multi-peer v0.0.5

Weekly downloads
6
License
CC0
Repository
github
Last release
10 years ago

Simple Multi Peer

WebRTC multi-peer communication made simple (using simple-peer)

Installation

$ npm install --save simple-multi-peer

Usage

As a signalling server it is recommended to use peer-hub.

var SimpleMultiPeer = require('simple-multi-peer');

var Peers = new SimpleMultiPeer({
  server: 'ws://localhost:3000', // Your signaller URL.
  room: 'foobar',                // Which 'room' you'll be using to communicate with your peers
                                 // (all peers in the same room will be signalled to each other).
  callbacks: {                   // Connection related callbacks
    connect: function() {},      // -> 2 peers are connected
    close: function() {},        // -> a connection is closed
    data: function() {},         // -> any data is received
  }
});

// Send data over a dataChannel to all peers
Peers.send('I'm alive!!!');

License

This code is released under CC0 (Public Domain)

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago