small logo created with Midjourney
A (very) basic BitTorrent client CLI written in C++. It implements from scratch parts of the BitTorrent protocol.
For now, it only supports downloading a single file from a single peer. It does not support seeding and it uses a naive strategy for piece selection (downloading pieces in order).
What it currently does:
- bencode
- .torrent file parsing
- peers discovery via tracker (HTTP)
- peer handshake and communication (TCP) for downloading pieces
./bittorrent info <torrent file>
./bittorrent peers <torrent file>
./bittorrent download_piece -o <output_file> <torrent file>
./bittorrent download -o <output_file> <torrent file># building
cmake . -B build
cmake --build build
# building with tests and debug
cmake . -B build -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build build --target test