Skip to content

Create a swarm of p2p connections using webrtc and a signalhub

License

Notifications You must be signed in to change notification settings

hackergrrl/webrtc-swarm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webrtc-swarm

Create a swarm of p2p connections using webrtc and a signalhub

npm install webrtc-swarm

Usage

var swarm = require('webrtc-swarm')
var signalhub = require('signalhub')
var wrtc = require('wrtc')

var hub = signalhub('swarm-example', ['http://yourdomain.com'])

var sw = swarm(hub, {
  wrtc: wrtc // you don't need this if you use it in the browser
})

sw.on('peer', function (peer, id) {
  console.log('connected to a new peer:', id)
  console.log('total peers:', sw.peers.length)
})

License

MIT

About

Create a swarm of p2p connections using webrtc and a signalhub

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%