A minimal bittorrent client made purely as a learning project, USE AT YOUR OWN RISK.
The mktorrent package is required to build test code.
go run main <add>|<info>|<tree> <path/to/file.torrent>
- The following commands are supported:
- add: Add a new torrent and start downloading.
- info: Display information about the torrent (total size, # of files, etc.)
- tree: Display the torrent file structure.
- <path/to/file.torrent> is the required path to a .torrent file.
- Parses bencoded .torrent files and tracker responses
- Supports bencoding structured data for serialization
- Parses peer message format
- Downloads single or multi-file torrents
- Checks existing data on disk and picks up from where you left off
- 3: Basic BitTorrent protocol (in progress)
- 23: Tracker Returns Compact Peer Lists
- Send 'have' messages to all peers when a piece is downloaded
- Run in background
- Blacklist misbehaving peers
- Specify destination directory
- More subcommands: remove, pause/resume
- More interesting bitmask visualization
- Use already-written bencode package to generate .torrent files (instead of pobrn/mktorrent)
- Better piece download strategies (rarest first)
- Better peer selection strategies (optimistic unchoking)
- Support the dictionary model for tracker responses listing available peers
- DHT
- Peer Exchange