Starting to play with alternative DHT implementations

This commit is contained in:
Igor Katson 2021-07-09 22:51:33 +01:00
parent e7c310a1df
commit 7a947ddf79
7 changed files with 232 additions and 8 deletions

View file

@ -0,0 +1,10 @@
const DHT = require('bittorrent-dht')
let dht = new DHT();
let infoHash = process.env["INFOHASH"];
dht.on('peer', function (peer, infoHash, from) {
console.log(peer.host + ':' + peer.port)
})
dht.lookup(infoHash)