Closed arestov closed 10 years ago
@asapach done
I'd like to preserve existing behavior: if opts.tracker: false
, no trackers should be used, regardless of opts.trackers
option.
in suggested code we can do
{
tracker: false,
trackers: null
}
to disable trackers completely.
And we can
{
tracker: false,
trackers: [...]
}
to use own list of trackers instead of list from torrent file.
But if tracker
disables trackers
how we can use own list of trackers instead of list form torrent file. I thought that this way is more flexible and better for API. What do you think?
Seems like a good point for me.
I'm merging this PR into the trackers
branch: https://github.com/mafintosh/torrent-stream/tree/trackers
I've added a couple of tests and they are failing at the moment.
Ran into an issue with bittorent-tracker: feross/bittorrent-tracker#19, tests still failing.
Now tests pass. And if we call .listen
immediately after engine instance has been created we do not recreate tracker. (With process.nextTick help)
@arestov, I'm trying to test this on public trackers (TPB, openbittorent, etc.), but always get connection refused (might be my ISP). Does it work for you?
Following code works for me
var Eng = require('./index');
var eng = Eng('magnet:?xt=urn:btih:2e0ba00b6ae7d68d03a61e682fe85e6964796b27&dn=Duck%20Sauce%20%E2%80%93%20NRG', {
dht: false,
trackers: [
'udp://tracker.openbittorrent.com:80',
'udp://tracker.ccc.de:80',
'udp://tracker.istole.it:80',
'udp://tracker.publicbt.com:80'
]
});
eng.on('ready', function() {
console.log('done')
});
This PR has been merged into #50. Let's continue discussion there.
Now we can use manual trackers list to speedup peers finding. Which accelerates start of downloading and with early trackers client init info-dictionary receiving.