Commit Graph

84 Commits

Author SHA1 Message Date
Feross Aboukhadijeh
d3a7c94f36 fix tests 2016-03-26 20:29:05 -07:00
Feross Aboukhadijeh
b5687c6a3b Revert "Re-enabled wrtc server tests, using SIGKILL to ensure Electron daemon gets killed"
This reverts commit 7369b6b900.
2016-03-26 19:46:15 -07:00
Matt Bell
7369b6b900 Re-enabled wrtc server tests, using SIGKILL to ensure Electron daemon gets killed 2016-03-25 00:34:37 -07:00
Feross Aboukhadijeh
5c5f986a54 disable websocket server tests 2016-03-24 05:09:21 -07:00
Feross Aboukhadijeh
0b7edf84a7 try to make wrtc test reliable on node v5 2016-03-24 01:35:19 -07:00
Feross Aboukhadijeh
d079171044 Fixes for PR #129 2016-03-16 17:58:47 -07:00
Yoann Ciabaud
c2115fbf7f Adds unit testing for websocket server 2016-03-16 17:33:06 -07:00
Feross Aboukhadijeh
e336f1a070 test: use webtorrent-fixtures 2016-03-16 12:22:33 -07:00
Yoann Ciabaud
eb3cefec35 Use type from server to filter peers to offer 2016-03-13 15:51:08 +01:00
Feross Aboukhadijeh
48d1f38e63 test/server: use common.createServer 2016-02-29 18:09:04 -08:00
Feross Aboukhadijeh
4207d80f28 test/scrape: use common.createServer 2016-02-29 17:55:31 -08:00
Feross Aboukhadijeh
3342c20b6b test: add test for ws tracker for filter tests 2016-02-29 17:39:03 -08:00
Feross Aboukhadijeh
2abab6c653 test: test http/ws trackers in magnet test 2016-02-29 17:15:03 -08:00
Feross Aboukhadijeh
fe4a6720b7 test: make large torrent test more thorough 2016-02-29 17:14:47 -08:00
Feross Aboukhadijeh
012b31553b test: add large torrent tests for ws tracker 2016-02-29 17:11:02 -08:00
Feross Aboukhadijeh
e15125ca80 test: add tests for getAnnounceOpts (#107) 2016-02-29 17:02:55 -08:00
Feross Aboukhadijeh
7893d5c5bf remove failing ws test 2016-02-29 17:02:36 -08:00
Feross Aboukhadijeh
7a0fe31ba5 add websocket tracker tests 2016-02-29 14:48:23 -08:00
Feross Aboukhadijeh
1e919c44cb changes for simple-get 2.0.0 2016-02-14 00:31:44 -08:00
Feross Aboukhadijeh
87d3189420 standard 6 prep 2016-02-05 14:08:46 -08:00
Feross Aboukhadijeh
b5096e91c3 Support async createSwarm() and getSwarm()
Fix #95.

Make server.getSwarm() and server.createSwarm() into async functions
that take a callback.
2016-01-03 19:50:23 +01:00
Feross Aboukhadijeh
15147880a2 test: remove sample trackers 2015-12-28 21:26:29 +01:00
Feross Aboukhadijeh
959ddbd5f3 fix test for setInterval() change 2015-12-05 00:06:23 -08:00
Feross Aboukhadijeh
38a80093a1 Fix UDP scrape returning invalid info hashes (Fix #97) 2015-12-02 15:35:42 -08:00
Feross Aboukhadijeh
9db28c2fad massive cleanup 2015-07-29 01:47:09 -07:00
Feross Aboukhadijeh
c3abef72ce tracker should not modify opts object, it's passed to all trackers 2015-07-27 15:19:18 -07:00
Feross Aboukhadijeh
89b3fb3086 support custom filter error messages
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
2015-07-08 10:13:52 -07:00
Feross Aboukhadijeh
bf5b9f289a BREAKING: opts.filter function is async; add createSwarm
- The expected signature for opts.filter is now:

function myFilterFn (infoHash, params, cb) {
  cb(infoHash === 'blah)
}

This allows interfacing with a database and fixes #80.

Also, swarm.getSwarm() is no longer responsible for creating a Swarm
instance, only returning an instance if there is already one. Creating
a swarm happens in swarm.createSwarm(). This change only affects users
who were override swarm.getSwarm().
2015-07-04 17:13:07 -07:00
Feross Aboukhadijeh
37f95b4b54 small cleanup 2015-07-04 17:10:41 -07:00
Feross Aboukhadijeh
02c92fd2ba randomize the peers that are given out 2015-05-19 04:32:09 -07:00
Feross Aboukhadijeh
f285c9dd3c client.stop() no longer calls client.destroy()
You must call client.destroy() manually to clean up resources
2015-05-16 23:24:20 -07:00
Feross Aboukhadijeh
1cc5a511bd udp server: support multiple info_hash scrape
Fixes #33
2015-05-01 17:36:07 -07:00
Feross Aboukhadijeh
03bed33457 add webtorrent (websocket) tracker server
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 })
```
2015-03-27 16:19:06 +13:00
Feross Aboukhadijeh
d759456d7a test: speed up 2015-03-24 01:02:10 -07:00
Feross Aboukhadijeh
6ac9ae6a6e perf: don't dynamically add new properties to peer objects 2015-02-02 15:20:15 -08:00
Feross Aboukhadijeh
82e6792a6b BREAKING CHANGES
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
2015-01-29 14:59:08 -08:00
Sidd Sridharan
55079798c5 white/blacklist implemented (#44) + docs/tests updated 2015-01-29 12:24:17 -08:00
Feross Aboukhadijeh
ebb86f728f JavaScript Standard Style
https://github.com/feross/standard
2015-01-26 18:16:01 -08:00
Feross Aboukhadijeh
94feea69e2 Support http tracker redirects, gzip/deflate 2015-01-22 14:23:53 -08:00
Feross Aboukhadijeh
69211515c2 encode special characters @*/+ in http tracker urls
Fixes https://github.com/feross/webtorrent/issues/196
2014-12-17 21:18:46 -08:00
Astro
d79bf92db0 server: ipv6 support 2014-12-13 00:12:47 +01:00
Feross Aboukhadijeh
79068a49cf Use hex info_hash and peer_id throughout 2014-12-12 02:02:11 -08:00
Astro
aea3c44c08 server: expose getSwarm()
drops capability to pass a *hex* infoHash
2014-12-09 23:18:47 +01:00
Astro
28189a0b12 server tests: fix serverType in announceUrl 2014-12-05 02:41:57 +01:00
Astro
f77015c046 server tests: run udp tests with udp 2014-12-04 17:38:03 +01:00
Feross Aboukhadijeh
32b622aa51 cleanup tests 2014-11-26 20:18:56 +08:00
Feross Aboukhadijeh
01286e2ee7 listen() without port picks random port 2014-08-16 19:05:56 -07:00
Feross Aboukhadijeh
9e22aa40f1 cleanup tests 2014-07-23 19:16:23 -07:00
Feross Aboukhadijeh
e6de7a2f54 add tests for scraping a udp tracker (fix #34) 2014-07-21 22:58:13 -07:00
Feross Aboukhadijeh
231ff5709c correctly detect UDP tracker scrape support
Before this fix, udp tracker urls needed to contain “/announce” or else
we would assume the tracker doesn’t support scrape. (This is correct
behavior for http trackers, but not udp)
2014-07-20 04:34:32 -07:00