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

Prevent destroying client on proxy config problem

  • Loading branch information
yciabaud committed Aug 26, 2016
commit 2a410fdd0f06bbe97269a192ceaaad2cc4214f44
@@ -125,7 +125,7 @@ function WebTorrent (opts) {
if (self.tracker && socksProxy && self.proxyOpts.proxyPeerConnections &&
process && process.versions['electron'] &&
(!self.tracker.wrtc || (self.tracker.wrtc && !self.tracker.wrtc.electronDaemon))) {
self.emit('error', 'You need to provide an electron-wrtc instance in opts.wrtc to use Socks proxy in electron -> WebRTC is disabled')
console.warn('You need to provide an electron-wrtc instance in opts.wrtc to use Socks proxy in electron -> WebRTC is disabled')

This comment has been minimized.

Copy link
@romaincointepas

romaincointepas Sep 5, 2016

console.warn('You need to provide an electron-wrtc instance in opts.wrtc to use Socks proxy in electron -> WebRTC is disabled')

I don't think this warning should be thrown if self.tracker.wrtc === false.

This comment has been minimized.

Copy link
@yciabaud

yciabaud Sep 6, 2016

Author Contributor

You are right

self.tracker.wrtc = false
}

@@ -139,7 +139,7 @@ function WebTorrent (opts) {
self.tracker.wrtc.electronDaemon.eval('window.webContents.session.setProxy(' +
JSON.stringify(electronConfig) + ', function(){})', networkSettingsReady)
} else {
self.emit('error', 'SOCKS Proxy must be version 5 with no authentication to work in electron-wrtc -> WebRTC is disabled')
console.warn('SOCKS Proxy must be version 5 with no authentication to work in electron-wrtc -> WebRTC is disabled')
self.tracker.wrtc = false
networkSettingsReady(null)
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.