Allow proxy usage on tracker clients#157
Allow proxy usage on tracker clients#157yciabaud wants to merge 14 commits intowebtorrent:masterfrom
Conversation
|
After some testing, looks like the UDP implementation is not ready yet. |
678c301 to
35d3d2a
Compare
|
OK UDP is working now, tested it with a local dante server and one provided by https://www.privateinternetaccess.com (thanks to @romaincointepas) Reviews are welcome! |
|
This is awesome. After this is in, I'll add proxy options to the Prefs page in WebTorrent Desktop |
lib/client/udp-tracker.js
Outdated
| function send (message) { | ||
| if (!parsedUrl.port) { | ||
| parsedUrl.port = 80 | ||
| function send (message, info) { |
|
OK changed the structure a little bit, tested more thoroughly and look good. What do you think about the new structure? |
…ent/bittorrent-tracker#157) and peer connexions in node (TCP/UDP) Fixes webtorrent#807
…ent/bittorrent-tracker#157) and peer connexions in node (TCP/UDP) Fixes webtorrent#807
…er from the message
Change proxy options structure and auto populate socks HTTP agents.
client.js
Outdated
| self._getAnnounceOpts = opts.getAnnounceOpts | ||
| self._proxyOpts = opts.proxyOpts | ||
|
|
||
| // Create HTTP agents from socks proxy if needed |
There was a problem hiding this comment.
You forgot to delete the part when you automatically create the http(s)Agents from the socksProxy.proxy object.
|
LGTM @yciabaud currently there's one style error -- https://travis-ci.org/feross/bittorrent-tracker/builds/155375449 Afterward I think we can merge it, release a new version, and then merge webtorrent/webtorrent#874 CC @feross |
|
You're right @dcposch , I have missed that. Fixed. |
|
@feross want to merge this? (I'm not on this repo) |
|
I can merge this but I wanted @feross feedback. He have to make the release afterwards anyway. |
|
Lots of good changes in here, and I'd like to use this functionality for another project now, so it'd be great if we could please have this reviewed, merged and published @feross! |
|
Will someone please Merge this. |
|
Is there any reason why you did not merge this @feross? |
|
Closed in favor of #356 |
Looking at webtorrent/webtorrent#807, I am trying to add proxy support to tracker clients.
For now, I am thinking about adding an http agent option to allow proxying HTTP and WebSocket request by using a Socks or a HTTP proxy agent.
For UDP, I am using the Socks module directly, @feross you suggested to use a socks instance to avoid adding a dependency but the module is not designed that way.
We could add a layer but this seemed a bit complicated for this feature...
I finally achieved to run a working socks proxy for UDP, so I could test all trackers successfully.
I believe it's ready to merge now, let me know what you think.