Client for the peer to peer BitTorrent protocol from scratch in Rust.
- Bencode encoding + decoding
- Parsing
.torrent
files for their metadata - Discovering peers with HTTP and UDP tracker protocols
- TCP peer wire message parsing
- Concurrently downloading pieces from many peers
- Multithreaded SHA1 hash checking for verifying pieces
- Downloading single and multi-file torrents
- Resuming partially complete torrents
- Seeding requested pieces
- Pipelining piece requests for higher throughput
- Asynchronous IO on a multithreaded runtime
- DHT, PEX, NAT traversal for more peers
- Rarest first/Choking/Super seeding algorithms
- Graphical/Web interface
- uTorrent transport protocol
- Piece paging/caching
To run, clone the repo and run
cargo run --release [torrent]
where [torrent]
is the path to the .torrent file. The client will proceed to download the torrent into the working directory.
Progress is given in completed pieces out of the total.