* Add a httpAgent options to http and websocket client trackers.
* Add a socks proxy to udp client trackers.
* Update http agent mock to node 5+
* Bugfix in socks configuration
* Use new socket to connect to the proxy relay and slice the proxy header from the message
* Add documentation for proxy
* Provide http and https agents for proxy.
Change proxy options structure and auto populate socks HTTP agents.
* Update documentation
* Check socks version for UDP proxy
* Clone proxy settings to prevent Socks instances concurrency
* Generate socks http agents on the fly (reuse is not working)
* Use clone to deepcopy socks opts
* Dont create agent for now since we cannot reuse it between requests.
* Removed unused require
* Add .gitignore
* Fix merge conflict
* Fix URL toString
* Fix new Socket constructor
Co-authored-by: Yoann Ciabaud <yoann@sonora.io>
This is just a defensive code change to ensure that if signal() were somehow able to cause the peer to synchronously emit the 'connect' event that we won't cause the 'error' listener to be unregistered before 'peer' is emitted and the user has a chance to register their own 'error' listener
For: https://github.com/brave/brave-browser/issues/5604
`bittorrent-tracker` is broken when run in a Chrome App environment.
The issue is that the `URL` constructor is buggy Chromium. https://bugs.chromium.org/p/chromium/issues/detail?id=734880
We switched to `URL` from `require('url')` in `bittorrent-tracker@9.13.0`. Commit: 93b41391a9
This code path was not exercised by `bittorrent-tracker`'s tests because UDP trackers are normally only used in a Node.js environment. Braves run the code in a Chrome extension environment which we don't test.
Handle peer 'error' events that are fired *before* the peer is emitted
in a 'peer' event. Once the peer is emitted in a 'peer' event, then
it's the consumer's responsibility to listen for errors.
This fixes the most common error in WebTorrent Desktop according to our
telemetry.