0x3d.Site
is designed for aggregating information.
rain
BitTorrent client and library in Go. Running in production at put.io since 2019. Processing thousands of torrents every day.
Features
- Core protocol
- Fast extension
- Magnet links
- Multiple trackers
- UDP trackers
- DHT
- PEX
- Message stream encryption
- WebSeed
- Fast resuming
- IP blocklist
- RPC server & client
- Console UI
- Tool for creating & reading .torrent files
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
import "github.com/cenkalti/rain/torrent"
// 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. One notable 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
The following features are not implemented in Rain, and this list should not be considered as a roadmap. These features are intentionally omitted either because they don't provide sufficient value for our use case at put.io, or because implementing them would add unnecessary complexity to the codebase. We prefer to maintain a focused and efficient implementation that serves our specific needs.
- IPv6 tracker extension
- IPv6 extension for DHT
- uTorrent transport protocol
- Superseeding
- HTTP seeding
- Merkle tree torrent extension
- uPnP port forwarding
- Selective downloading
- Sequential downloading
Contributing
Rain is primarily developed to serve the specific requirements of put.io. Due to this focused purpose, feature requests that do not align with put.io's needs are likely to be rejected. Additionally, we maintain a strong preference for simplicity in implementation - complex solutions, even if technically superior, will generally not be accepted. Please keep these guidelines in mind when submitting issues or pull requests.
Star History
Programming Tips & Tricks
Code smarter, not harder—insider tips and tricks for developers.
#1
#2
#3
#4
#5
#6
#7
#8
#9
#10
Error Solutions
Turn frustration into progress—fix errors faster than ever.
#1
#2
#3
#4
#5
#6
#7
#8
#9
#10
Shortcuts
The art of speed—shortcuts to supercharge your workflow.
#1
#2
#3
#4
#5
#6
#7
#8
#9
#10
Made with ❤️
to provide resources in various ares.