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

Add proxy options to allow proxying tracker and peer connections #874

Open
wants to merge 16 commits into
base: master
from
Open
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

Forward proxyOpts to the tracker when proxyTrackerConnections is true

  • Loading branch information
yciabaud committed Aug 24, 2016
commit 02b9b287c00b2d018e0d67e8e024d551fe7b6a32
@@ -113,6 +113,13 @@ function WebTorrent (opts) {
self.proxyOpts.proxyTrackerConnections = self.proxyOpts.proxyTrackerConnections !== false
self.proxyOpts.proxyPeerConnections = self.proxyOpts.proxyPeerConnections !== false

if (self.proxyOpts.proxyTrackerConnections && !self.tracker.proxyOpts) {
if (!self.tracker) {

This comment has been minimized.

Copy link
@romaincointepas

romaincointepas Aug 24, 2016

self.tracker is already set to an empty object above (see https://github.com/yciabaud/webtorrent/blob/405a084da5406a59acf168460d038b449d26a5a3/index.js#L86), no need for this here?

This comment has been minimized.

Copy link
@yciabaud

yciabaud Aug 24, 2016

Author Contributor

self.tracker can still be false, but I should skip the forwarding if it is.

This comment has been minimized.

Copy link
@romaincointepas

romaincointepas Aug 24, 2016

Indeed, good catch!

self.tracker = {}
}
self.tracker.proxyOpts = self.proxyOpts
}

if (self.proxyOpts.socksProxy) {
if (!self.proxyOpts.socksProxy.proxy) self.proxyOpts.socksProxy.proxy = {}
if (!self.proxyOpts.socksProxy.proxy.type) self.proxyOpts.socksProxy.proxy.type = 5
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.