Commit Graph

40 Commits

Author SHA1 Message Date
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
Astro
b33531d835 server: allow onHttpRequest() with options={ action: 'announce' } for custom routing
For GH issue #58
2015-02-04 20:35:52 +01: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
Feross Aboukhadijeh
ebb86f728f JavaScript Standard Style
https://github.com/feross/standard
2015-01-26 18:16:01 -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
Feross Aboukhadijeh
c75ca05479 swarm.announce() should always call callback
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.
2014-12-11 13:43:11 -08:00
Feross Aboukhadijeh
edb5c6e854 code style 2014-12-11 12:53:39 -08:00
Astro
c97e4236f4 server parseHttpRequest(): simplify info_hash checking 2014-12-11 17:07:37 +01:00
Astro
e64fecc063 parseUdpRequest(): throw on invalid packet 2014-12-11 16:19:08 +01:00
Astro
7a417a591d parseUdpRequest(): fix params.ip 2014-12-11 16:11:12 +01:00
Astro
e234f14d56 server swarm: split out announce events 2014-12-10 17:01:34 +01:00
Astro
8439300df9 server: unify compact serialization 2014-12-10 16:51:35 +01:00
Astro
b72960dee3 server: split out Swarm 2014-12-10 16:47:41 +01:00
Astro
1c754a2f49 move parseHttpRequest(), parseUdpRequest() to lib/parse_{http,udp}.js 2014-12-10 00:44:45 +01:00
Astro
0bc88bcf22 server: split out parseUdpRequest() 2014-12-09 00:22:36 +01:00
Feross Aboukhadijeh
be875c40af Fix serious client+server encoding error (fix #32) 2014-07-12 18:44:41 -07:00
Feross Aboukhadijeh
ce171f196c move common encode/decode fns to common.js 2014-07-10 21:28:37 -07:00
Feross Aboukhadijeh
c403e5c29f split client and server into separate files 2014-06-07 15:11:30 -07:00