Commit Graph

120 Commits

Author SHA1 Message Date
Feross Aboukhadijeh
056a83d1b5 feross -> webtorrent 2017-04-14 12:50:19 -07:00
Feross Aboukhadijeh
90121a62c2 remove unnecessary quotes 2017-04-04 11:46:43 -07:00
Feross Aboukhadijeh
0c683dfe64 test: change request handler test to new approach 2017-03-10 13:39:12 -08:00
Feross Aboukhadijeh
51b57f66cf test: remove UDP request handler test -- not possible 2017-03-10 13:39:02 -08:00
Yoann Ciabaud
1efb832dd7 Remove debug log 2017-03-09 11:19:46 +01:00
Yoann Ciabaud
146d4d46dd Extension point on requests and responses 2017-03-09 11:19:46 +01:00
Feross Aboukhadijeh
40202a00b7 BREAKING: change how the filter function works
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
2017-03-01 22:54:40 -08:00
Feross Aboukhadijeh
cd4a976121 add failing tests for desired evicition behavior 2017-02-08 13:12:39 -08:00
Feross Aboukhadijeh
4422067607 test: server: check that all clients, server are destroyed 2017-02-08 13:11:48 -08:00
Feross Aboukhadijeh
e731106279 test: ensure electron-webrtc is started only for test where it's needed
before this change, it was getting initialized immediately, since it
was outside a tape test block
2017-02-08 13:11:35 -08:00
Feross Aboukhadijeh
29d4564bbd remove unneeded timeout 2017-02-08 12:27:50 -08:00
Feross Aboukhadijeh
fb751d7c96 Re-enable ws server tests (websocket tracker) 2017-01-29 16:25:16 -08:00
Feross Aboukhadijeh
c3bf7f87f6 test: add failing test for the second part of #190 2017-01-20 18:34:05 -08:00
Feross Aboukhadijeh
63d24611ec test: speed up testClientUpdate() test 2017-01-20 18:33:30 -08:00
Feross Aboukhadijeh
1424a00c3a test: don't rely on setTimeout in testClientStop() 2017-01-20 18:33:17 -08:00
Feross Aboukhadijeh
ee45b7947b update filter tests to clarify multiple clients 2017-01-20 18:32:59 -08:00
Feross Aboukhadijeh
c4f4f012dd Add fixes and tests for PR #179 2017-01-16 15:43:47 -08:00
Feross Aboukhadijeh
15a35cedd9 add test: no "update" events after destroy() 2016-09-16 07:49:49 -07:00
Feross Aboukhadijeh
55eda0ed93 Run all tests 2016-08-05 18:41:25 -07:00
Feross Aboukhadijeh
59bba81c5a Fix Client.scrape returns no error on invalid URL
Fix #167.
2016-08-05 18:23:43 -07:00
Feross Aboukhadijeh
a59a3069b5 Fix webtorrent version parsing 2016-07-29 18:18:32 -07:00
Yoann Ciabaud
f76b27c12a Merge pull request #160 from yciabaud/lru-pruning
Limit peers in tracker server with LRU based cache fixes #4
2016-07-19 19:50:25 +02:00
Feross Aboukhadijeh
cc783392c4 fixes for standard v8 2016-07-13 13:54:19 -07:00
Yoann Ciabaud
2ac65725a1 Merge pull request #158 from yciabaud/stats-clients
Add stats on clients based on peerIds
2016-06-23 15:08:23 +02:00
Yoann Ciabaud
29fcf30cb4 Use correct HTTP header to work with JSON on GET 2016-06-13 00:34:26 +02:00
Yoann Ciabaud
d51a77b028 Update lru package to 3.0.0 and set peersCacheLength to 1K as default 2016-06-10 10:00:19 +02:00
Yoann Ciabaud
1dbc95cbdc Add pruning to server tests.
Issue #4
2016-06-09 01:28:49 +02:00
Yoann Ciabaud
ca522c0c4b Prune old peers in server with lru based cache. Issue #4 2016-06-08 23:57:01 +02:00
Yoann Ciabaud
f8c7de5213 Add stats on clients based on peerIds 2016-06-07 14:34:38 +02:00
Yoann Ciabaud
d7a651f360 Fixes for PR #155 2016-06-07 10:49:27 +02:00
Feross Aboukhadijeh
52aacc1db0 Merge pull request #156 from yciabaud/scrape-test
Restore scrape test for websocket tracker now it is is supported
2016-06-04 23:09:20 -07:00
Yoann Ciabaud
54782bc7e0 Restore scrape test for websocket tracker now it is is supported 2016-06-04 15:50:46 +02:00
Feross Aboukhadijeh
2959c2cea6 Use safe-buffer
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
2016-05-29 23:12:23 -07:00
Feross Aboukhadijeh
5e8fefc7d1 disable stalling websocket server tests 2016-03-31 23:35:26 -07:00
Feross Aboukhadijeh
9a48e1c10a Add failing test for #141 2016-03-31 21:48:21 -07:00
Feross Aboukhadijeh
2966165a8f BREAKING: Client() takes single opts object now
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.
2016-03-31 21:37:51 -07:00
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