Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

announceList is not replacing default trackers #1604

Open
lacker opened this issue Mar 28, 2019 · 6 comments
Open

announceList is not replacing default trackers #1604

lacker opened this issue Mar 28, 2019 · 6 comments
Labels

Comments

@lacker
Copy link

@lacker lacker commented Mar 28, 2019

Using:
webtorrent@0.103.0
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.

@Fenny

This comment has been minimized.

Copy link

@Fenny Fenny commented May 8, 2019

Same results here

announceList: [['ws://localhost:8000']]

Image

@andymikulski

This comment has been minimized.

Copy link

@andymikulski andymikulski commented May 17, 2019

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.)

@Fenny

This comment has been minimized.

Copy link

@Fenny Fenny commented May 18, 2019

Heroes don't always wear capes @andymikulski , this issue is solved.

@lacker

This comment has been minimized.

Copy link
Author

@lacker lacker commented Jun 7, 2019

This workaround works for me. I think the current behavior is still a bug that should be fixed though.

@stale

This comment has been minimized.

Copy link

@stale stale bot commented Sep 5, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Sep 5, 2019
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Sep 5, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.