Commit Graph

56 Commits

Author SHA1 Message Date
Feross Aboukhadijeh
15a6f3c715 require('bittorrent-tracker') returns Client 2014-06-07 15:15:00 -07:00
Feross Aboukhadijeh
c403e5c29f split client and server into separate files 2014-06-07 15:11:30 -07:00
Feross Aboukhadijeh
cf074e12a8 fix debug usage 2014-06-06 00:25:51 -07:00
Feross Aboukhadijeh
c52169d136 add debug messages 2014-06-06 00:23:02 -07:00
Feross Aboukhadijeh
20d14391d5 http server: support announce at / 2014-06-05 23:40:37 -07:00
Feross Aboukhadijeh
85b7c606b9 add debug 2014-06-05 23:40:22 -07:00
Feross Aboukhadijeh
202bfe8385 add server.listen(port, onlistening) shorthand 2014-06-05 23:40:13 -07:00
Feross Aboukhadijeh
a5aab16807 minor style 2014-06-05 00:18:00 -07:00
John Hiesey
effd911f21 Remove semicolons 2014-06-05 00:05:08 -07:00
John Hiesey
48baf2bfa6 Time out and clean up udp stopped messages
This solves one of the problems with the bittorrent-client tests
not exiting
2014-06-05 00:05:08 -07:00
Feross Aboukhadijeh
fe559e0db7 force ipv4 addresses for node 0.11+ 2014-05-23 21:25:20 -07:00
Feross Aboukhadijeh
387c1e536e udp client: clean up timer situation 2014-05-23 21:02:09 -07:00
Feross Aboukhadijeh
cc4c73ec24 Revert "udp client: unref the socket"
This reverts commit 6f1aa981d4.

Conflicts:
	index.js
2014-05-23 20:44:48 -07:00
Feross Aboukhadijeh
0ff2c1917b timeout might not be defined 2014-05-23 20:43:12 -07:00
Feross Aboukhadijeh
351f829104 udp client: don't set a timer for stopped message 2014-05-23 20:34:46 -07:00
Feross Aboukhadijeh
6f1aa981d4 udp client: unref the socket 2014-05-23 20:34:31 -07:00
Feross Aboukhadijeh
9bf68da828 udp client: add try-catches around close() 2014-05-23 20:34:23 -07:00
Feross Aboukhadijeh
783263f3a0 add udp tracker server
fixes #9
2014-05-23 19:44:57 -07:00
Feross Aboukhadijeh
872518d1b5 client support for udp tracker error message 2014-05-23 18:01:13 -07:00
Mathias Buus
98d1b0a17c only handle response if there is any data 2014-05-22 17:42:44 +02:00
Feross Aboukhadijeh
e83328babe fix bug where client mangles tracker port
The client was converting the binary (compact) response to a utf8
string which would modify the data in some cases. Keeping it as a
buffer the whole time solves the issue.

Fixes #19.
2014-05-18 18:36:40 -07:00
Feross Aboukhadijeh
418e996b81 add tracker server jsdoc comment 2014-05-18 17:58:03 -07:00
Feross Aboukhadijeh
239e4f6add remove vim comment 2014-05-17 12:52:06 -07:00
fisch0920
d7b567554f Merge remote-tracking branch 'upstream/master' 2014-05-15 06:30:11 -04:00
fisch0920
c4684c8b72 fixed issue where an erroneous tracker could cause webtorrent to crash because socket.close was already closed after an error state 2014-05-15 06:29:47 -04:00
Feross Aboukhadijeh
cc80088038 handle case where parsedTorrent.length is undefined
- Expose `torrentLength` so the user can set it when they know the
torrent length. (With a magnet uri, they won’t know the length at the
time the Client is instantiated)
- UDP Client: Send FFFFFFFFFFFFFFFF for ‘left’ param when we don’t know
the size. (This is what Transmission does)

Fixes #15.
2014-05-14 12:49:15 -07:00
Feross Aboukhadijeh
2983811a71 handle case where magnet uri has only one 'tr' param 2014-05-14 12:46:15 -07:00
Feross Aboukhadijeh
bbe2fa35bf upgrade bn.js 2014-05-11 23:58:42 -07:00
fisch0920
50d3379255 Merge remote-tracking branch 'upstream/master' 2014-05-12 01:14:42 -04:00
fisch0920
a69ee07871 added slightly better error logging 2014-05-12 01:14:24 -04:00
Feross Aboukhadijeh
e5e0fa9e27 minor style cleanup 2014-05-11 17:32:57 -07:00
Feross Aboukhadijeh
94ae74b32d remove new trick for non-exported function 2014-05-11 16:41:47 -07:00
fisch0920
5064a05dde added client and server support for scrape messages in addition to announce messages (tcp and udp) 2014-05-09 02:38:41 -04:00
fisch0920
931f0a5a48 refactored tracker tracker Client into a container for multiple Trackers each with their own, independent update interval and trackerIds 2014-05-09 00:23:14 -04:00
Mathias Buus
64eaa3f936 use bn.js instead of bignum 2014-04-30 23:02:19 +02:00
Feross Aboukhadijeh
5d970f70e5 make bignum an optional dependency 2014-04-19 01:32:42 -07:00
Feross Aboukhadijeh
dfd5149d6b fix #11 - support torrents with 64-bit file sizes 2014-04-18 23:28:59 -07:00
Feross Aboukhadijeh
b0a659f00c [udp server] add stub implementation 2014-04-18 23:05:21 -07:00
Feross Aboukhadijeh
c38cdd94e1 i'm getting tired 2014-04-11 22:00:03 -07:00
Feross Aboukhadijeh
8eba7da318 fix the fix 2014-04-11 21:57:19 -07:00
Feross Aboukhadijeh
4daca0540c bugfix: client send correct peerId to server 2014-04-11 21:55:06 -07:00
Feross Aboukhadijeh
e87f800b94 kill nbsp 2014-04-09 22:15:24 -07:00
Feross Aboukhadijeh
5c7ebb7b58 style 2014-04-04 23:27:38 -07:00
thermatk
c8cc97afea Fix for unknown port
For example, in torrents from Yify their tracker has url "udp://tracker.yify-torrents.com/announce" in which case a crtitical error is shown because "port should be in range from 0 to 65535"
2014-04-04 19:59:25 +04:00
Mathias Buus
ff289c6b23 unrefing timeout to not hang on stop 2014-03-28 17:11:19 +01:00
Feross Aboukhadijeh
1721eed413 udp client: unify error handling 2014-03-27 21:29:23 -07:00
Feross Aboukhadijeh
e5b516f987 handle some more edge cases, code style, add todos 2014-03-27 21:04:33 -07:00
Feross Aboukhadijeh
5c09dcd55f code style 2014-03-27 21:04:33 -07:00
Mathias Buus
0557ce6f65 basic udp tracker support 2014-03-27 21:04:33 -07:00
Mathias Buus
f39d9d1c5e emit err instead of req on error 2014-03-28 00:34:53 +01:00