0.3.0 • Published 9 years ago

ipfs-mdns v0.3.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

node-ipfs-mdns

npm.io npm.io npm.io

Node.js IPFS mDNS discovery implementation

Usage

var Sonar = require('ipfs-mdns')

var snr = new Sonar(peer, options, swarm)

snr.on('peer', function (peerFound) {
  console.log('Found a local peer', peerFound.id.toB58String())
})
  • peer - The peer that represents itself. Must be of a type ipfs-peer
  • swarm - swarm, needed in order to verify if we are able to establish a connection with the other peer
  • options
    • broadcast - (true/false) announce our presence through mDNS
    • interval - query interval
    • serviceTag - name of the service announced (default to "discovery.ipfs.io.local")
    • verify - Verifies if we can establish a connection with the peer, before emitting a peer event