• Stars
    star
    953
  • Rank 47,957 (Top 1.0 %)
  • Language
    Go
  • License
    MIT License
  • Created over 10 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🌧 BitTorrent client and library in Go

rain

BitTorrent client and library in Go. Running in production at put.io since 2019.

GoDoc GitHub Release Coverage Status Go Report Card

Features

Screenshot

Rain Screenshot

Installing

If you are on MacOS you can install from brew:

brew install cenkalti/rain/rain

Otherwise, get the latest binary from releases page.

Usage as torrent client

Rain is distributed as single binary file. The main use case is running rain server command and operating the server with rain client <subcommand> commands. Server consists of a BitTorrent client and a RPC server. rain client is used to give commands to the server. There is also rain client console command which opens up a text based UI that you can view and manage the torrents on the server. Run rain help to see other commands.

Usage as library

// Create a session
ses, _ := torrent.NewSession(torrent.DefaultConfig)

// Add magnet link
tor, _ := ses.AddURI(magnetLink, nil)

// Watch the progress
for range time.Tick(time.Second) {
	s := tor.Stats()
	log.Printf("Status: %s, Downloaded: %d, Peers: %d", s.Status.String(), s.Bytes.Completed, s.Peers.Total)
}

More complete example can be found under handleDownload function at main.go file.

See package documentation for complete API.

Configuration

All values have sensible defaults, so you can run Rain with an empty config but if you want to customize it's behavior, you can pass a YAML config with -config flag. Config keys must be in lowercase. See the description of values in here: config.go

Difference from other clients

Rain is the main BitTorrent client used at put.io. It is designed to handle hundreds of torrents while using low system resources. The main difference from other clients is that Rain uses a separate peer port for each torrent. This allows Rain to download same torrent for multiple accounts in same private tracker and keep reporting their ratio correctly.

Missing features

More Repositories

1

backoff

⏱ The exponential backoff algorithm in Go
Go
3,369
star
2

github-flask

🍾 Flask extension for GitHub API
Python
264
star
3

dalga

⏰ MySQL backed Job Scheduler with a HTTP interface
Go
248
star
4

kuyruk

⚙️ Simple task queue for Python
Python
231
star
5

dominantcolor

Find dominant color in images
Go
119
star
6

rpc2

Bi-directional RPC in Go (Golang)
Go
108
star
7

pypi-notifier

📨 A web service that monitors your requirements.txt files
Python
100
star
8

putio.py

A python wrapper for put.io APIv2
Python
72
star
9

pyhtml

HTML generation library for Python
Python
70
star
10

tus.py

tus (resumable file upload protocol) client in python
Python
34
star
11

what

A helper for testing output of a process in tests.
Python
24
star
12

darbe

RDS MySQL replication setup tool
Python
18
star
13

tcpproxy

TCP proxy server written in Go
Go
13
star
14

resume

My resume
9
star
15

mse

BitTorrent Message Stream Encryption in Go
Go
9
star
16

go-sched

A generally useful event scheduler in Go (Golang).
Go
8
star
17

hub

Simple PubSub (Publish/Subscribe) library in Go (Golang)
Go
8
star
18

dotfiles

dotfiles management with git
Shell
7
star
19

catalyst

Caches binaries and libraries and runs a command. Used usually for decreasing release size of applications.
Go
7
star
20

kuyruk-manager

See and manage Kuyruk workers.
Python
6
star
21

AI-Writer

Swift
6
star
22

putiofs

A FUSE wrapper around put.io API v2
Python
5
star
23

remux

HTTP router that routes requests based on regex patterns.
Go
4
star
24

httpagain

Graceful restart for HTTP server (Golang)
Go
4
star
25

redialer

Generic redialer for connection-like types in Go
Go
4
star
26

container-manager

Go
3
star
27

bitfield

bitfield implementation in go
Go
3
star
28

seslisozluk-chrome

SesliSozluk.com Chrome Extension
JavaScript
3
star
29

kuyruk-go

Library for sending Kuyruk tasks from Go programs
Go
3
star
30

bcount

Cardinality counter that uses bloom filter internally.
Go
3
star
31

debe-postasi

Python
3
star
32

putio-osx-menubar

Swift
2
star
33

putio-treemap

Python
2
star
34

kuyruk-requeue

Save failed tasks to Redis and requeue them.
Python
2
star
35

math.kite

Example kite for demonstating kite framework
Go
2
star
36

puke

generate data for http speed testing
Go
2
star
37

pb

Turn long command outputs to a nice progress bar
Go
1
star
38

cenkalti.com

My home page
HTML
1
star
39

overlord

Process manager
C
1
star
40

kuyruk-sentry

Sends exceptions in Kuyruk workers to Sentry.
Python
1
star
41

cpu-guard

Shows MacOS notification if a process uses too much CPU
Swift
1
star