libp2p-mdns-discovery JavaScript Implementation
Node.js libp2p mDNS discovery implementation
Usage
var Sonar = require('libp2p-mdns-discovery')
var snr = new Sonar(peer, options, swarm)
snr.on('peer', function (peerInfo) {
console.log('Found a peer in the local network', peerFound.id.toB58String())
})
- peer - The peer that represents itself. Must be of a type peer-info
- 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 mDNSinterval
- query intervalserviceTag
- name of the service announced (default to "discovery.ipfs.io.local")verify
- Verifies if we can establish a connection with the peer, before emitting apeer
event