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

feat: add preference to customize global trackers #1836

Merged
merged 5 commits into from May 11, 2022

Conversation

subins2000
Copy link
Contributor

@subins2000 subins2000 commented Jul 16, 2020

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[ ] Bug fix
[x] New feature
[ ] Other, please explain:

What changes did you make? (Give an overview)

Added a new preference item, "Global Trackers". This list will be used as the default announceList instead of create-torrent module's list. This is done by setting the global variable WEBTORRENT_ANNOUNCE

image

Currently it requires a restart for the changes to apply. But I wonder if changes to WEBTORRENT_ANNOUNCE will reflect in app runtime after init ? 🤔

Tracker changes will apply on pause & resume of a torrent.

Which issue (if any) does this pull request address?

#881

Is there anything you'd like reviewers to focus on?

Does changes to WEBTORRENT_ANNOUNCE reflect in app runtime after init ? 🤔 My guess is that torrent needs to be paused and resumed for the new trackers to get applied ?

Changes to WEBTORRENT_ANNOUNCE will reflect to future webtorrent client.add calls. So pausing and resuming a torrent is enough.

@subins2000 subins2000 marked this pull request as ready for review July 16, 2020 21:51
@feross
Copy link
Member

feross commented Jul 17, 2020

Rather than setting global.WEBTORRENT_ANNOUNCE, you can just pass in the announce option to the client.add or client.seed methods. That will add the specified trackers to the list of used trackers.

See: https://github.com/webtorrent/webtorrent/blob/2b8f65ab59422a70fe23d529bb9380d71e6cc2d8/lib/torrent.js#L262-L265

@subins2000
Copy link
Contributor Author

subins2000 commented Jul 17, 2020

In #881, I read

we're currently adding four default webtorrent (ws:// and wss://) trackers to all torrents without making this very clear to users. There is an argument to be made that we should allow users to turn this off (just from a privacy perspective)`

So change needs to be made to the global variable too, right ? That'd ensure user's choice to choose the tracker they want.

I'm now trying to avoid loading state in webtorrent.js and instead use IPC to pass the global trackers list. done in the next commits

@github-actions
Copy link

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@github-actions github-actions bot added the stale label Jul 22, 2021
@subins2000
Copy link
Contributor Author

Yes, this is still relevant. Ability to change the default trackers used is important, from a privacy perspective and user experience. Users have submitted duplicate issues since the creation of this PR asking this (#881).

@github-actions github-actions bot removed the stale label Jul 23, 2021
@github-actions
Copy link

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@github-actions github-actions bot added the stale label Sep 22, 2021
@alxhotel alxhotel added accepted and removed stale labels Sep 22, 2021
@DiegoRBaquero DiegoRBaquero self-assigned this Oct 19, 2021
@DiegoRBaquero DiegoRBaquero changed the title Add preference to customize global trackers feat: add preference to customize global trackers Oct 19, 2021
@DiegoRBaquero
Copy link
Member

@subins2000 is this good to go?

@subins2000
Copy link
Contributor Author

@DiegoRBaquero I just tested this locally again to confirm that it works. I see that using global.WEBTORRENT_ANNOUNCE or globalThis.WEBTORRENT_ANNOUNCE has the same effect but since the original was globalThis I changed to that in the last commit. All good to go!

@DiegoRBaquero DiegoRBaquero merged commit c943f39 into webtorrent:master May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants