Commit Graph

70 Commits

Author SHA1 Message Date
Feross Aboukhadijeh
4128604301 remove socket from pool on destroy 2015-07-29 03:21:31 -07:00
Feross Aboukhadijeh
f5d2810c89 Announce to websocket tracker every 30 seconds (for #338) 2015-07-29 02:12:14 -07:00
Feross Aboukhadijeh
9db28c2fad massive cleanup 2015-07-29 01:47:09 -07:00
Feross Aboukhadijeh
3746c05d79 restructure folders 2015-07-29 00:26:44 -07:00
Feross Aboukhadijeh
2dc56de223 rename files 2015-07-29 00:06:59 -07:00
Feross Aboukhadijeh
5aa0696a34 fix crash, oops 2015-07-27 15:46:49 -07:00
Feross Aboukhadijeh
c8fcf81908 fix for node 0.10 2015-07-27 15:28:23 -07:00
Feross Aboukhadijeh
a49a0d8d18 remove stray log 2015-07-27 15:24:34 -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
c42335af43 unref timer 2015-07-16 18:33:54 -07:00
Feross Aboukhadijeh
5b79d42dcd client: destroy callback isn't called until after cleanup 2015-07-16 18:33:50 -07:00
Feross Aboukhadijeh
b5d8748db4 fix crash on invalid udp tracker response 2015-07-06 17:48:39 -07:00
Feross Aboukhadijeh
37f95b4b54 small cleanup 2015-07-04 17:10:41 -07:00
Feross Aboukhadijeh
96f6fce1ab only return correct peer type from swarm 2015-06-06 13:10:49 -07:00
Feross Aboukhadijeh
da5036424b fix exception in websocket tracker 2015-05-30 14:20:42 -07:00
Feross Aboukhadijeh
ac2c3d06d8 client: Re-use WebSocket connections
Use a socket pool, so tracker clients share WebSocket objects for the
same server.

In practice, WebSockets are pretty slow to establish, so this gives a
nice performance boost, and saves browser resources.
2015-05-27 13:09:15 +02:00
Feross Aboukhadijeh
3be06d6684 always produce valid urls with trailing /
Fixes this error:

ERROR: connection error to wss://tracker.webtorrent.io?1fe16837ed
ERROR: If you think this is a bug in webtorrent, report it!
2015-05-22 16:21:55 +02:00
Feross Aboukhadijeh
c1bbade6d7 cache infohash and peerid 2015-05-20 06:45:59 -07:00
Feross Aboukhadijeh
bb145cce14 ws client: ignore offers/answers from self 2015-05-20 06:40:25 -07:00
Feross Aboukhadijeh
d40eeccf4d limit webrtc offers to 10 2015-05-19 04:32:17 -07:00
Feross Aboukhadijeh
02c92fd2ba randomize the peers that are given out 2015-05-19 04:32:09 -07:00
Feross Aboukhadijeh
2505e13009 after socket destroy, ignore all future errors 2015-05-17 13:53:36 -07:00
Feross Aboukhadijeh
d78b678f5b fix regression: double cleanup bug 2015-05-17 01:47:12 -07:00
Feross Aboukhadijeh
0482c01a47 ws client: better offline reconnect behavior
Fixes https://github.com/feross/webtorrent/issues/318
2015-05-17 00:07:21 -07:00
Feross Aboukhadijeh
8788d75737 udp/ws clients: add destroy functions
Fixes #75
2015-05-16 23:25:34 -07:00
Feross Aboukhadijeh
ee91dff19d client: add http tracker destroy function 2015-05-16 22:55:41 -07:00
Feross Aboukhadijeh
2b48883742 ws tracker: JSON.stringify messages 2015-05-05 23:05:10 -07:00
Feross Aboukhadijeh
938c025ed9 remove wrtc dependency
For #303
2015-05-03 17:21:08 -07:00
Feross Aboukhadijeh
9a6e854609 Limit number of WebRTC offers to only 5 2015-05-03 16:53:37 -07:00
Feross Aboukhadijeh
68f2317870 Revert "prevent "value out of bounds error""
This reverts commit 25b25f663c.
2015-05-03 16:46:39 -07:00
Feross Aboukhadijeh
1338282cc9 prevent negative complete/incomplete numbers
Fixes #65
Fixes #72
2015-05-03 16:38:16 -07:00
Feross Aboukhadijeh
4c3c950056 One more fix for IPv6 UDP support
For #73
2015-05-03 14:20:17 -07:00
Feross Aboukhadijeh
25b25f663c prevent "value out of bounds error"
For #72
2015-05-01 21:32:54 -07:00
Feross Aboukhadijeh
1cc5a511bd udp server: support multiple info_hash scrape
Fixes #33
2015-05-01 17:36:07 -07:00
Feross Aboukhadijeh
d705be775e generate 5 offers in the browser, not 50 2015-04-30 21:00:14 -07:00
Feross Aboukhadijeh
ee3ea92c47 fix webrtc support detection in browser 2015-04-23 23:27:12 -07:00
Feross Aboukhadijeh
814b167e8a bittorrent-tracker/client should work if wrtc fails to install 2015-04-23 22:48:39 -07:00
Feross Aboukhadijeh
e0afafc776 don't return empty wrtc object in browser 2015-04-23 21:15:40 -07:00
Feross Aboukhadijeh
f1cc540e79 Fix negative leecher count issue
Fixes #65
2015-04-20 20:02:05 -07:00
Feross Aboukhadijeh
a5d0975dfa Do not crash when wrtc dep is missing 2015-04-20 16:38:59 -07:00
Feross Aboukhadijeh
f302bee0bb simple-websocket@2 2015-04-11 11:58:21 +12:00
Feross Aboukhadijeh
97222ed16d typo 2015-04-01 17:36:33 +13:00
Feross Aboukhadijeh
7e7062d2ae websocket tracker server/client: fix binary vs. hex bugs 2015-03-29 21:08:26 +13:00
Feross Aboukhadijeh
13e7ff7057 set self._opts correctly 2015-03-29 20:41:25 +13:00
Feross Aboukhadijeh
df8de6f608 client/websocket: warning on invalid info_hash 2015-03-29 20:40:21 +13:00
Feross Aboukhadijeh
b269fb9db4 fix debug statements 2015-03-29 20:39:18 +13: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
1ff5769054 add support for webtorrent (websocket) trackers 2015-03-24 01:52:35 -07:00
Feross Aboukhadijeh
f575cfc3c9 major client refactor - each tracker type into its own file
in preparation of adding a new websocket tracker type, for webtorrent
2015-03-24 01:01:49 -07:00
Feross Aboukhadijeh
57cef88169 style: always use braces except for single-line 2015-03-06 18:12:59 -08:00