Using:
[email protected]
Ubuntu 18.04.2 LTS
Node v8.10.0
When I seed a new torrent and set announceList to be my own set of trackers, it appears that the default set of trackers is still included. Here's the code:
let client = new WebTorrent();
let dir = path.resolve(__dirname, "samplesite");
client.seed(
dir,
{
announceList: [["ws://localhost:4444"]]
},
torrent => {
console.log("seeding torrent.");
console.log("info hash: " + torrent.infoHash);
console.log("magnet: " + torrent.magnetURI);
torrent.on("wire", (wire, addr) => {
console.log("connected to peer with address", addr);
});
}
);
The magnet URI includes tracker URLs besides just localhost, which is why I conclude it isn't properly using announceList. The docs on https://github.com/webtorrent/create-torrent state "If announceList is omitted, the following trackers will be added automatically: ..." which is why I expected it to not auto-add any trackers when announceList is provided.
Same results here
announceList: [['ws://localhost:8000']]

After some digging, it looks like it's an issue around webtorrent-hybrid. I've found running this line of code before seeding/downloading files will remove the default trackers:
(typeof global === 'undefined' ? window : global).WEBTORRENT_ANNOUNCE = null;
(global in node environments and window in the browser.)
Heroes don't always wear capes @andymikulski , this issue is solved.
This workaround works for me. I think the current behavior is still a bug that should be fixed though.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Yeah, we should try to fix this, if possible. webtorrent-hybrid and the global.WEBTORRENT_ANNOUNCE is kind of a hack.
The whole reason I created webtorrent-hybrid was that installing the WebRTC in Node.js package (wrtc) used to cause lots of install warnings/errors for most users at one point in time. If the situation has improved since then, we can just include wrtc directly in the webtorrent package and deprecate webtorrent-hybrid.
Most helpful comment
After some digging, it looks like it's an issue around
webtorrent-hybrid. I've found running this line of code before seeding/downloading files will remove the default trackers:(typeof global === 'undefined' ? window : global).WEBTORRENT_ANNOUNCE = null;(
globalin node environments andwindowin the browser.)