Skip to content

Create a swarm of authenticated p2p connections using webrtc and a signalhub.

License

Notifications You must be signed in to change notification settings

peermusic/secure-webrtc-swarm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

secure-webrtc-swarm

A wrapper around webrtc-swarm that adds peer whitelisting and authenticated asymmetric encryption of the WebRTC signaling data using that is passed among peers via signalhub using TweetNaCl.js (see crypto-ratchet.md).

Install

npm install https://github.com/peermusic/secure-webrtc-swarm.git

Usage

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 for reference.

License

MIT

About

Create a swarm of authenticated p2p connections using webrtc and a signalhub.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%