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

Move tracker options into `opts.tracker` (#649) #791

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Next

WIP running tests for changes in opts

  • Loading branch information
nkittsteiner committed May 6, 2016
commit c5429d697aaf4b26fa9f7b0d37eb33843882558c
@@ -68,12 +68,14 @@ function WebTorrent (opts) {
self.listening = false
self.torrentPort = opts.torrentPort || 0
self.dhtPort = opts.dhtPort || 0
self.tracker = opts.tracker !== undefined ? opts.tracker : true
self.tracker = opts.tracker !== undefined ? opts.tracker : {}
self.torrents = []
self.maxConns = Number(opts.maxConns) || 55

self._rtcConfig = opts.rtcConfig
self._wrtc = opts.wrtc || global.WRTC // to support `webtorrent-hybrid` package
if (typeof self.tracker === 'object') {
self.tracker.rtcConfig = opts.rtcConfig
self.tracker.wrtc = opts.wrtc || global.WRTC // to support `webtorrent-hybrid` package
}

This comment has been minimized.

Copy link
@feross

feross May 8, 2016

Member

These options should be passed into the tracker constructor, not set directly on the tracker object like this.

This comment has been minimized.

Copy link
@feross

feross May 8, 2016

Member

Nevermind.


if (typeof TCPPool === 'function') {
self._tcpPool = new TCPPool(self)
@@ -292,8 +292,8 @@ Torrent.prototype._onListening = function () {
var self = this
if (self.discovery || self.destroyed) return
var trackerOpts = {
rtcConfig: self.client._rtcConfig,
wrtc: self.client._wrtc,
rtcConfig: self.client.tracker.rtcConfig,
wrtc: self.client.tracker.wrtc,
getAnnounceOpts: function () {
var opts = {
uploaded: self.uploaded,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.