Gordon Hall
11 years ago
3 changed files with 88 additions and 2 deletions
@ -0,0 +1,15 @@ |
|||
var PeerManager = require('../PeerManager'); |
|||
var peerman = new PeerManager(); |
|||
|
|||
peerman.discoverPeers(function(err, peers) { |
|||
// we get an array of peer instances
|
|||
console.log(peers); |
|||
// the peer manager caches the tried seeds and any results
|
|||
console.log(peerman.seeds); |
|||
// we can use this array of peers to add to the manager
|
|||
peers.forEach(function(p) { |
|||
peerman.addPeer(p); |
|||
}); |
|||
// then we can start the manager
|
|||
peerman.start(); |
|||
}); |
Loading…
Reference in new issue