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

Is it possible to add trackers programmatically? #770

Closed
chrisnharvey opened this issue Apr 24, 2016 · 4 comments
Closed

Is it possible to add trackers programmatically? #770

chrisnharvey opened this issue Apr 24, 2016 · 4 comments

Comments

@chrisnharvey
Copy link

@chrisnharvey chrisnharvey commented Apr 24, 2016

Hi,

I'm looking for the ability to add trackers to a torrent that is already downloading, is this possible.

I'm looking for something along the lines of:

torrent.addTracker('wss://tracker.com')
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Apr 24, 2016

Sorry -- this is not supported. You have to add trackers upfront:

client.add(torrentId, { announce: 'wss://tracker.com' })

What is the use case for this?

@chrisnharvey

This comment has been minimized.

Copy link
Author

@chrisnharvey chrisnharvey commented Apr 24, 2016

I'm creating a private tracker to allow the download of software from my site.
I was thinking that the tracker URL will contain a key to identify a user and their access to the torrent. Which would change every so often to prevent it from being shared. So it would need to delete the old tracker URL and replace it with a new one containing a new key.
I'm probably completely over thinking this so please let me know if you know of a simpler way to achieve this.
Sent from my Samsung Galaxy smartphone.
-------- Original message --------From: Feross Aboukhadijeh notifications@github.com Date: 24/04/2016 9:43 a.m. (GMT+00:00) To: feross/webtorrent webtorrent@noreply.github.com Cc: Chris Harvey chris@chrisnharvey.com, Author author@noreply.github.com Subject: Re: [feross/webtorrent] Is it possible to add trackers programmatically? (#770)
Sorry -- this is not supported. You have to add trackers upfront:

client.add(torrentId, { announce: ''wss://tracker.com' })

What is the use case for this?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Apr 24, 2016

You might consider using the getAnnounceOpts property of the client.add function. It's documented here: https://github.com/feross/bittorrent-tracker#client

You could use it like this:

var token = 1

client.add(torrentId, {
   // include a token parameter in announce requests to the server
  getAnnounceOpts: function () {
    return {
      token: token
    }
  }
})

// update the token every 10s
setInterval(function () {
  token += 1
}, 10000)
@feross feross closed this Apr 24, 2016
@lock

This comment has been minimized.

Copy link

@lock lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

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