A light-weight BitTorrent client written in Go, providing a robust peer-to-peer file sharing solution.
- Torrent Parsing
- Reads .torrent files to extract metadata.
- Peer Communication
- Establishes communication with peers using TCP.
- Bitfield Handling
- Processes peer bitfields to track peer availability.
- Timeout Management
- Configurable timeouts for read/write operations to handle network delays or unresponsive peers.
- Prerequisites
- Go 1.20+
- Clone the Repository
git clone https://github.com/lokeshllkumar/bittorrent-client
cd bittorrent-client
- Installing dependencies
go mod tidy
- Build the Project
go build .
Execute the program with a .torrent
file.
./bittorent-client <path-to-torrent-file> <path-to-output-file>
The client will parse the torrent file, retrieve information about peers, connect to peers and exchange handshake messages, and download the file in pieces from multiple peers.