This PR merges webtorrent-tracker into this repo. Keeping the code in
sync between the two repos was becoming burdensome. This change should
not effect performance of the server since the webtorrent tracker is
disabled by default.
To enable the webtorrent tracker (disabled by default), do:
```js
var server = new Server({ ws: true })
```
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
It’s important that calls to swarm.announce() always calls the callback
that it’s passed otherwise http announce/scrape requests
will hang (because res.end() is never called).
Also, since this swarm implementation is in-memory, we can get rid of
the callbacks to internal functions.
Lastly, fixed references to non-existent start() function.