New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

github.com/handsomefox/gobittorrent

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/handsomefox/gobittorrent

v0.0.0-20240919211221-8c5f22ab5642
Version published
Created

gobittorrent

A working single-file cli torrent client written in Go.

This is a command-line program that can:

  • Decode and encode bencoded values
  • Decode torrent files
  • Decode announce messages
  • Show the available peers
  • Do the handshake with multiple peers
  • Exchange messages with multiple peers (partially)
  • Download (single-file) files from peers

Build

Run make build to build the project. The binary is stored in the bin folder inside of it.

Usage

gobittorrent

Commands:
  decode <string>
    decodes a bencoded string and outputs it as json
  peers <.torrent file>
    shows the available peers for the given .torrent file
  info <.torrent file>
    shows the decoded representation of the .torrent file
  handshake <.torrent file> <peer>
    does the handshake with the given peer, which is a string that looks like: "host:port"
  download <.torrent file> <output file>
    downloads a single-file torrent to the specified file
  help
    display this message

Usage:
  gobittorrent decode 5:hello
  gobittorrent decode d3:foo3:bar5:helloi52ee
  gobittorrent peers sample.torrent
  gobittorrent info sample.torrent
  gobittorrent handshake sample.torrent 1.1.1.1:1111
  gobittorrent download sample.torrent ./output.txt

FAQs

Package last updated on 19 Sep 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