bittorrent

package module
v0.0.0-...-101a212 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2022 License: MIT Imports: 14 Imported by: 0

README

BitTorrent client in Go

Initially based off of a blog post from Jesse Li to implement the OG BitTorrent protocol.

Supports

  • Original Spec (BEP0003)
    • Multi-file .torrent files
    • Original and Compact Peer List formats (BEP0023)

TODO

  • Implement 'endgame mode' as described in BEP0003 for downloading the last few pieces
  • Seeding in OG .torrent protocol
  • Magnet links - might go w/ udp trackers
    • UDP Trackers (BEP0015)
      • can acquire a list of peers (ip & port) from a UDP tracker url
    • UDP Extensions (BEP0041)
    • Extension to download metadata from peers (BEP0009)
  • DHT
  • PEX
  • Fast Extension (BEP0006)
  • Announce list - i.e. Multitracker Metadata Extension (BEP0012)
  • uTorrent Transport Protocol (BEP0029)
  • Some pretty terminal visual of pieces being downloaded?

Documentation

Overview

Package bittorrent implements the client side (downloads) of the BitTorrent protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Download

type Download struct {
	// contains filtered or unexported fields
}

func NewDownload

func NewDownload(source string) (*Download, error)

NewDownload sets up a download given a source string (supports torrent file and magnet links. It attempts to get peer addresses from tracker servers, then gets metadata from peers if necessary (i.e. source is a magnet link). Once setup, the Download.Run() method will start the peer to peer download.

func (*Download) Run

func (d *Download) Run(outDir string) error

Run the peer to peer download process, concurrently getting pieces from each connected peer.

The outDir defaults to the current directory, "./"

Directories

Path Synopsis
cmd
Package peer is a client implementation (TCP only) to peers in the swarm.
Package peer is a client implementation (TCP only) to peers in the swarm.
Package torrentfile parses torrent files or magnet links.
Package torrentfile parses torrent files or magnet links.
Package tracker gets peers from (HTTP/S and UDP) tracker servers.
Package tracker gets peers from (HTTP/S and UDP) tracker servers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL