Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

small logo created with Midjourney

wBittorrent

GitHub Actions Workflow Status

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

Usage

./bittorrent info <torrent file>
./bittorrent peers <torrent file>
./bittorrent download_piece -o <output_file> <torrent file>
./bittorrent download -o <output_file> <torrent file>

Build

# 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

Resources used

About

Small re-implementation of a bittorrent client

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages