Giter Site home page Giter Site logo

bittorrent-client's Introduction

A minimal bittorrent client made purely as a learning project, USE AT YOUR OWN RISK.

The mktorrent package is required to build test code.

Usage

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.

Features

  • 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

Supported BEPs (BitTorrent Enhancement Proposals)

  • 3: Basic BitTorrent protocol (in progress)
  • 23: Tracker Returns Compact Peer Lists

TODOs

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

Optimizations

  • Better piece download strategies (rarest first)
  • Better peer selection strategies (optimistic unchoking)

Protocol

  • Support the dictionary model for tracker responses listing available peers

Extensions

  • DHT
  • Peer Exchange

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.