Skip to content

A lightweight BitTorrent client implementation in Go, capable of parsing .torrent files, discovering peers, and downloading files using the BitTorrent protocol.

Notifications You must be signed in to change notification settings

lokeshllkumar/bittorrent-client

Repository files navigation

bittorent-client

A light-weight BitTorrent client written in Go, providing a robust peer-to-peer file sharing solution.

Features

  • 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.

Setup and Installation

  • 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 .

Usage

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.

About

A lightweight BitTorrent client implementation in Go, capable of parsing .torrent files, discovering peers, and downloading files using the BitTorrent protocol.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published