Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/esmakov/bittorrent-client

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/esmakov/bittorrent-client

  • v0.0.0-20241016184711-b24194e5eba1
  • Source
  • Go
  • Socket score

Version published
Created
Source

A simple CLI bittorrent client

The mktorrent package is required to build test code.

Usage

go run main <add>|<info>|<parse> <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.)
    • parse: 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 and implements the peer message protocol
  • 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

  • Handle more than one torrent at a time

  • Send keepalives

  • Switch over to bytes.Buffer where appropriate

  • Blacklist misbehaving peers

  • Specify download directory

  • More interesting bitmask visualization?

  • Use already-written bencode package to generate .torrent files (instead of pobrn/mktorrent)

  • Set log level (debug, info, errors)

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

FAQs

Package last updated on 16 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc