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
+157
−65
Open
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
10d816e
Allow proxying tracker calls and peer connexions in node (TCP/UDP)
yciabaud 40fb20c
Add WebRTC proxy with electron-webrtc
yciabaud 02b9b28
Forward proxyOpts to the tracker when proxyTrackerConnections is true
yciabaud abda226
Dont forward proxyOpts to the tracker if set to false
yciabaud 072aad6
Clone options before using it in socks
yciabaud 6d313db
Remove socks agent generation since it cannot be reused between requests
yciabaud 124bfc9
Use clone to deepcopy socks opts and add socks agent generation to we…
yciabaud f127199
Fix a bug in cloning / extending
yciabaud 1583308
Check for proxy requirements in electron
yciabaud ac34a89
Disable WebRTC when proxy not compatible but continue with other tran…
yciabaud 3fe91ef
Cleanup and error checking
yciabaud 69a66a8
Fix IDE adding semi...
yciabaud bf564ba
Handle missing wrtc prop
yciabaud 2a410fd
Prevent destroying client on proxy config problem
yciabaud ba6269b
Run the proxy settings in the electron-wrtc main process
yciabaud 04399a6
Remove useless conditions conditions
yciabaud File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
Loading status checks…
Forward proxyOpts to the tracker when proxyTrackerConnections is true
- Loading branch information
| @@ -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) { | ||
yciabaud
Author
Contributor
|
||
| 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
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?