* 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>
- Uses class, const let, etc
- Removed self variable
- Creating a new Client without `new` keyword don’t work anymore
- Replaced inherits with class extends
Caught this issue because of the new eviction tests. Essentially, this
change moves the socketPool into the client instance instead of a
reused variable at the module level.
When a client sends stop (or is evicted) the server will close the
websocket connection if that client is not in any other swarms (based
on peerId). However, if we are using a single socket for multiple
clients (as was the case before this commit), then other clients will
have their sockets unintentionally closed by the server.
Use the new Buffer APIs from Node v6 for added security. For example,
`Buffer.from()` will throw if passed a number, unlike `Buffer()` which
allocated UNINITIALIZED memory in that case.
Use the `safe-buffer` package for compatibility with previous versions
of
Node.js, including v4.x, v0.12, and v0.10.
https://github.com/feross/safe-buffer
To use the client, you used to pass in four arguments:
`new Client(peerId, port, parsedTorrent, opts)`
Now, passing in the torrent is no longer required, just the `announce`
and `infoHash` properties. This decouples this package from
`parse-torrent`.
All options get passed in together now:
new Client({
infoHash: '', // hex string or Buffer
peerId: '', // hex string or Buffer
announce: [], // list of tracker server urls
port: 6881 // torrent client port, (in browser, optional)
})
All the normal optional arguments (rtcConfig, wrtc, etc.) can still be
passed in with the rest of these options.
Fixes#118. Fixes#115.
Added ws tests for scrape.