1 # A command line BitTorrent client.
3 I started writing a BitTorrent client because it seemed like fun
4 and I am learning Haskell and wanted to see if I can write something
5 real with Haskell than just heat the room. It is turning out to be a
10 You need to install [Stack](https://github.com/commercialhaskell/stack), either via
11 the OS package manager or via `cabal` (`cabal install stack`).
13 $ git clone https://github.com/vu3rdd/functorrent && cd functorrent
14 $ cabal install stack # or install stack by other means
15 $ stack build # binaries in $(pwd)/.stack-work/install/x86..../lts-2.16/7.8.4/bin/functorrent
19 If you invoke functorrent without any options, it expects the contents of a torrent file
20 to be given in stdin. So
22 $ cat ubuntu-14.10-desktop-amd64.iso.torrent | functorrent
25 Or one can explicitly specify the torrent file as input.
27 $ functorrent ubuntu-14.10-desktop-amd64.iso.torrent
32 - [Optimized for Fun](http://www.slideshare.net/autang/ofun-optimizing-for-fun).
33 (should have called it "funtorrent")
34 - Become more profient with Haskell.
35 - Implement something non-trivial with Haskell (crypto, file operations, network
36 operations, concurrency, bit twiddling, DHT).
37 - Follow the spec ([official spec](http://bittorrent.org/beps/bep_0003.html), [unofficial spec](https://wiki.theory.org/BitTorrentSpecification))
38 - Easy for newbies like me to read and understand alongside the spec.
39 - doctest and quickcheck tests.
40 - Follow Haskell Style Guide - https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md
44 This client is not usable as your daily BitTorrent client yet. You may get
45 corrupted files and end up wasting a lot of bandwidth. So, until we achieve
46 some robustness, consider this as a programmer-friendly project to learn
47 about a bunch of stuff.
51 - most of the peer wire protocol works.
52 - talks only to one peer at the moment.
53 - can download files. But needs every piece to be served by the peer it connected to.
54 - can talk to http/udp trackers.
59 - Talk to multiple peers concurrently.
60 - Piece download algorithms.
61 - Multifile torrent support.
62 - Magnet link support.
63 - other advanced features of BitTorrent (like DHT).
67 The Bangalore Haskell group forked an early version of this code and started to develop it as a group. My code has diverged a lot from it. Both are calling it functorrent. Perhaps that needs to be fixed.