Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upProvide a way to give extra data to the tracker on announce #595
Conversation
This comment has been minimized.
This comment has been minimized.
|
What's your use case for sending extra parameters to the tracker? Some kind of authentication? |
| @@ -90,6 +90,7 @@ function Torrent (torrentId, opts) { | |||
| this.pieces = [] | |||
| this._selections = [] | |||
| this._critical = [] | |||
| this._getExtraAnnounceOpts = opts.getExtraAnnounceOpts | |||
This comment has been minimized.
This comment has been minimized.
feross
Feb 8, 2016
Member
I'd rather name this consistently with the bittorrent-tracker option. getAnnounceOpts
| uploaded: self.uploaded, | ||
| downloaded: self.downloaded, | ||
| left: self.length - self.downloaded, | ||
| extraAnnounceOpts: self._getExtraAnnounceOpts && self._getExtraAnnounceOpts() |
This comment has been minimized.
This comment has been minimized.
feross
Feb 8, 2016
Member
Instead of passing the user's custom announce opts separately in this extraAnnounceOpts property, can we merge their properties with the uploaded, downloaded, and left params?
Thinking something like this:
getAnnounceOpts: function () {
return extend({
uploaded: self.uploaded,
downloaded: self.downloaded,
left: self.length - self.downloaded
}, self._getExtraAnnounceOpts && self._getExtraAnnounceOpts())
})This ordering will mean that the user's values for uploaded, downloaded, and left (if they exist) will take precedence.
This comment has been minimized.
This comment has been minimized.
|
LGTM |
This comment has been minimized.
This comment has been minimized.
|
For now I am sending per wire statistics in order to track data transfer between peers, the bitfield to compute video playing stats (see when the consumer seeks and stops the video...) but later I want my tracker to provide an optimized peerlist to reduce latency. So I will probably retrieve more metrics. |
Provide a way to give extra data to the tracker on announce
This comment has been minimized.
This comment has been minimized.
|
Good news! This is released as 0.80.0. |
This comment has been minimized.
This comment has been minimized.
|
Thank you for finishing this. |
This comment has been minimized.
This comment has been minimized.
|
Of course! Thanks for the PR! |
This comment has been minimized.
This comment has been minimized.
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. |
yciabaud commentedFeb 4, 2016
This PRs is dependent on webtorrent/bittorrent-tracker#107 and webtorrent/torrent-discovery#15 to provide a callback for the client to get updated params and send it along with the announce message to the tracker.
It sends updated download stats (uploaded/downloaded/letf and adds a callback in th options to extend it with additionnal data.
The callback is called before every announce to get updated data from the client.