Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/nihey/simple-multi-peer
- Owner: nihey
- Created: 2015-07-31T14:14:46.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-10T17:20:57.000Z (about 7 years ago)
- Last Synced: 2024-08-09T02:59:22.798Z (6 months ago)
- Topics: javascript, rtcpeerconnection-wrappers, webrtc
- Language: JavaScript
- Size: 3.91 KB
- Stars: 15
- Watchers: 5
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
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)