Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peermusic/secure-webrtc-swarm
Create a swarm of authenticated p2p connections using webrtc and a signalhub.
https://github.com/peermusic/secure-webrtc-swarm
Last synced: 3 months ago
JSON representation
Create a swarm of authenticated p2p connections using webrtc and a signalhub.
- Host: GitHub
- URL: https://github.com/peermusic/secure-webrtc-swarm
- Owner: peermusic
- License: mit
- Fork: true (perguth/secure-webrtc-swarm)
- Created: 2016-08-29T18:52:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-01-08T11:37:41.000Z (about 9 years ago)
- Last Synced: 2024-08-01T17:33:17.581Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-peer-to-peer - secure-webrtc-swarm - swarm` with whitelisting and encryption. (Modules)
- awesome-peer-to-peer - secure-webrtc-swarm - swarm` with whitelisting and encryption. (Modules)
README
# secure-webrtc-swarm
> A wrapper around [webrtc-swarm](https://github.com/mafintosh/webrtc-swarm) that adds peer whitelisting and authenticated asymmetric encryption of the WebRTC signaling data using that is passed among peers via [signalhub](https://github.com/mafintosh/signalhub) using [TweetNaCl.js](https://github.com/dchest/tweetnacl-js
) (see [crypto-ratchet.md](crypto-ratchet.md)).## Install
```sh
npm install https://github.com/peermusic/secure-webrtc-swarm.git
```## Usage
```js
var nacl = require('tweetnacl')
var signalhub = require('signalhub')
var swarm = require('secure-webrtc-swarm')var hub = signalhub('swarm-example', ['http://yourdomain.com'])
var keyPair = nacl.box.keyPair()var sw = swarm(hub, keyPair)
sw.on('peer', function (peer, id) {
console.log('connected to a new peer:', id)
console.log('total peers:', sw.peers.length)
})
```Adding inviting peers works by modifying the `sw` object or already providing the relevant information while setting `sw` up. See the [example](example.js) for reference.
## License
MIT