Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nihey/simple-multi-peer

WebRTC multi peer communication made simple
https://github.com/nihey/simple-multi-peer

javascript rtcpeerconnection-wrappers webrtc

Last synced: about 15 hours ago
JSON representation

WebRTC multi peer communication made simple

Awesome Lists containing this project

README

        

# Simple Multi Peer

WebRTC multi-peer communication made simple (using [simple-peer](https://github.com/feross/simple-peer))

# Installation
```
$ npm install --save simple-multi-peer
```

# Usage

As a signalling server it is recommended to use [peer-hub](https://github.com/nihey/node-peer-hub).

```javascript
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](http://creativecommons.org/publicdomain/zero/1.0/) (Public Domain)