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

Disable WebRTC when proxy not compatible but continue with other tran…

…sports
  • Loading branch information
yciabaud committed Aug 26, 2016
commit ac34a891396aecd52e116f6bd1f2c12916fe06cc
@@ -124,7 +124,8 @@ function WebTorrent (opts) {
if (self.proxyOpts.socksProxy && self.proxyOpts.proxyPeerConnections &&
process && process.versions['electron'] &&
self.tracker.wrtc && !self.tracker.wrtc.electronDaemon) {
return self.emit('error', 'You need to provide an electron-wrtc instance in opts.wrtc to use socks in electron')
self.emit('error', 'You need to provide an electron-wrtc instance in opts.wrtc to use Socks proxy in electron -> WebRTC is disabled')
self.tracker.wrtc = false
}

// Convert proxy opts to electron API in webtorrent-hybrid
@@ -137,7 +138,9 @@ 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')
self.emit('error', 'SOCKS Proxy must be version 5 with no authentication to work in electron-wrtc -> WebRTC is disabled')
self.tracker.wrtc = false
networkSettingsReady(null)
}
} else {
networkSettingsReady(null)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.