bittorrent-client-with-magnet

BitTorrent Client (with 🧲) Wiki

This is the wiki page for the BitTorrent client implementing BEP 3: The BitTorrent Protocol Specification and BEP 9: Extension for Peers to Send Metadata Files.

After reading this wiki, you should understand the various components that comprise this codebase, reason about how they interact with one another, and ultimately be able to adapt this code to your needs or write a BitTorrent client yourself 🙂.

Let’s get started!

Overview

Before we begin, I recommended skimming the following in order:

  1. Jesse Li’s Building a BitTorrent client from the ground-up in Go
  2. BEP 3: The BitTorrent Protocol Specification
  3. BEP 9: Extension for Peers to Send Metadata Files

You should have an idea of how to answer the following:

Architecture

TODO

Directory Structure

Parse Torrent File

TODO

Query Tracker

TODO

Connect to Peers

TODO

Download from Peers

TODO

Regenerate file

TODO

Debugging

TODO: Insert Wireshark debugging screenshot or video

Wireshark is a network packet analyzer that understands the format of packets specified by the BitTorrent protocol. Analyzing the packets sent or received (or lack thereof) will let you know if any packet is misconstructed.

Future Work