BREAKING CHANGE: drop simple-get
* perf: drop simple-get
* feat: undici agent and socks
* fix: undici as dev dependency
* feat: require user passed proxy objects for http and ws
* chore: include undici for tests
* Updated docs to better match default server config
* docs: updated to more recent version
* docs: Changed var to const
* Update README.md
Co-authored-by: Diego Rodríguez Baquero <github@diegorbaquero.com>
* 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>
It's non-standard for a callback function to take a non-error argument
in the first position.
So instead of the filter callback accepting three types of arguments:
cb(true) // allowed
cb(false) // disallowed
cb(new Error('custom message')) // disallowed with custom message
It now accepts two forms:
cb(new Error('custom message')) // disallowed with custom message
cb(null) // allowed
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.
In addition to returning a boolean (`true` for allowed, `false` for
disallowed), you can return an `Error` object to disallow and provide a
custom reason.
Fixes#85
Breaking changes:
- 'listening' event no longer emits with `port` param
- `server.port` property removed (instead, use
`server.http.address().port`)
Added features:
- expose http server as `server.http`
- expose udp server as `server.udp`
- client.destroy() - ungracefully leave the swarm
- server: added `filter` option to black/whitelist torrents
Bugfixes:
- client considers udp tracker errors to be warnings
- emit 'start', 'stop', 'update', etc. AFTER response sent
- fix udp error response action and message being `undefined`
Internal:
- remove `portfinder` dep
- add complete test for `filter` functionality