Skip to content

Commit

Permalink
[node] Added session default DHT routers
Browse files Browse the repository at this point in the history
  • Loading branch information
aldenml committed Feb 3, 2016
1 parent e2e4a1c commit 49b24fa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions node/jlibtorrent.js
Expand Up @@ -134,6 +134,15 @@ const swig = require('./jlibtorrent.node');
setInterval(session_alerts_loop, 1000);
}

function defaultRouters() {
var list = [];

list.push(new swig.string_int_pair("router.bittorrent.com", 6881));
list.push(new swig.string_int_pair("dht.transmissionbt.com", 6881));

return list;
}

function Session(settings, logging, listener) {
EventEmitter.call(this);

Expand All @@ -147,6 +156,12 @@ const swig = require('./jlibtorrent.node');
}

alertsLoop(this, this.s);

var arr = defaultRouters();
var size = arr.length;
for (var i = 0; i < size; i++) {
this.s.add_dht_router(arr[i]);
}
}

util.inherits(Session, EventEmitter);
Expand Down

0 comments on commit 49b24fa

Please sign in to comment.