Skip to content
Experimental mdns swarm with a shared distributed state
JavaScript Protocol Buffer
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.gitignore
README.md
clog.js
commit.proto
index.js
mdns.js
package.json
utils.js

README.md

hyperswarm

Hyperswarm is an experimental mdns swarm with a shared distributed state.

It relies heavily on multicast-dns and hyperemitter.

Install

npm install --save hyperswarm

Use

var hswarm = require('hyperswarm')

// ComputerA
var a = hswarm('superswarm')

// ComputerB on the same network
var b = hswarm('superswarm')

// A little while later...
a.setState({ volume : 5 })
setTimeout(function() {
    b.state.get('volume') // => 5
},100)

// Computer C on the same network, even more later...
var c = hswarm('superswarm')
setTimeout(function() {
    c.state.get('volume') // => 5
},100)

// Cleanup
a.close()
b.close()
c.close()

Changelog

1.1.0

  • Broadcasting availability on active interface (if none specified)

1.0.2

  • Added missing metadata to package.json

1.0.1

  • Fixed path to proto file when used as module
  • Change event passes changeset instead of merged state, one can always get the state

1.0.0

  • Initial release 🎉

enjoy.

You can’t perform that action at this time.