{"id":13412632,"url":"https://github.com/cenkalti/rain","last_synced_at":"2025-05-14T14:08:38.010Z","repository":{"id":17246199,"uuid":"20015471","full_name":"cenkalti/rain","owner":"cenkalti","description":"🌧 BitTorrent client and library in Go","archived":false,"fork":false,"pushed_at":"2025-05-05T20:40:08.000Z","size":3633,"stargazers_count":1044,"open_issues_count":3,"forks_count":76,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-05-09T03:42:56.433Z","etag":null,"topics":["bittorrent","golang","p2p","torrent"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cenkalti.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-05-21T09:17:24.000Z","updated_at":"2025-05-06T10:32:29.000Z","dependencies_parsed_at":"2023-12-10T14:23:41.810Z","dependency_job_id":"9cf6bef7-b13f-4622-b8a5-96e64ae8e8cb","html_url":"https://github.com/cenkalti/rain","commit_stats":{"total_commits":2056,"total_committers":16,"mean_commits":128.5,"dds":0.04912451361867709,"last_synced_commit":"d9eed00a6df1fcb2407643447764747a135d08a8"},"previous_names":["cenk/rain"],"tags_count":167,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cenkalti%2Frain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cenkalti%2Frain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cenkalti%2Frain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cenkalti%2Frain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cenkalti","download_url":"https://codeload.github.com/cenkalti/rain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254159853,"owners_count":22024565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bittorrent","golang","p2p","torrent"],"created_at":"2024-07-30T20:01:27.018Z","updated_at":"2025-05-14T14:08:37.992Z","avatar_url":"https://github.com/cenkalti.png","language":"Go","funding_links":[],"categories":["开源类库","Distributed Systems","分布式系统","Open source library","Go","Relational Databases"],"sub_categories":["网络","Search and Analytic Databases","检索及分析资料库","The Internet","Advanced Console UIs","SQL 查询语句构建库"],"readme":"rain\n====\n\n\u003cimg src=\"https://github.com/cenkalti/rain/raw/master/logo.png\" width=\"100\"\u003e\n\n---\n\nBitTorrent client and library in Go. Running in production at [put.io](putio-link) since 2019. Processing thousands of torrents every day.\n\n[![GoDoc](https://godoc.org/github.com/cenkalti/rain?status.svg)](https://pkg.go.dev/github.com/cenkalti/rain/torrent?tab=doc)\n[![GitHub Release](https://img.shields.io/github/release/cenkalti/rain.svg)](https://github.com/cenkalti/rain/releases)\n[![Coverage Status](https://coveralls.io/repos/github/cenkalti/rain/badge.svg)](https://coveralls.io/github/cenkalti/rain)\n[![Go Report Card](https://goreportcard.com/badge/github.com/cenkalti/rain)](https://goreportcard.com/report/github.com/cenkalti/rain)\n\nFeatures\n--------\n- [Core protocol](http://bittorrent.org/beps/bep_0003.html)\n- [Fast extension](http://bittorrent.org/beps/bep_0006.html)\n- [Magnet links](http://bittorrent.org/beps/bep_0009.html)\n- [Multiple trackers](http://bittorrent.org/beps/bep_0012.html)\n- [UDP trackers](http://bittorrent.org/beps/bep_0015.html)\n- [DHT](http://bittorrent.org/beps/bep_0005.html)\n- [PEX](http://bittorrent.org/beps/bep_0011.html)\n- [Message stream encryption](http://wiki.vuze.com/w/Message_Stream_Encryption)\n- [WebSeed](http://bittorrent.org/beps/bep_0019.html)\n- Fast resuming\n- IP blocklist\n- RPC server \u0026 client\n- Console UI\n- Tool for creating \u0026 reading .torrent files\n\nScreenshot\n----------\n![Rain Screenshot](https://cl.ly/b03c639da66c/Screen%20Shot%202019-09-30%20at%2019.04.00.png)\n\nInstalling\n----------\n\nIf you are on MacOS you can install from [brew](https://brew.sh/):\n```sh\nbrew install cenkalti/rain/rain\n```\n\nOtherwise, get the latest binary from [releases page](https://github.com/cenkalti/rain/releases).\n\nUsage as torrent client\n-----------------------\n\nRain is distributed as single binary file.\nThe main use case is running `rain server` command and operating the server with `rain client \u003csubcommand\u003e` commands.\nServer consists of a BitTorrent client and a RPC server.\n`rain client` is used to give commands to the server.\nThere is also `rain client console` command which opens up a text based UI that you can view and manage the torrents on the server.\nRun `rain help` to see other commands.\n\nUsage as library\n----------------\n\n```go\nimport \"github.com/cenkalti/rain/torrent\"\n\n// Create a session\nses, _ := torrent.NewSession(torrent.DefaultConfig)\n\n// Add magnet link\ntor, _ := ses.AddURI(magnetLink, nil)\n\n// Watch the progress\nfor range time.Tick(time.Second) {\n\ts := tor.Stats()\n\tlog.Printf(\"Status: %s, Downloaded: %d, Peers: %d\", s.Status.String(), s.Bytes.Completed, s.Peers.Total)\n}\n```\n\nMore complete example can be found under `handleDownload` function at [main.go](https://github.com/cenkalti/rain/blob/master/main.go) file.\n\nSee [package documentation](https://pkg.go.dev/github.com/cenkalti/rain/torrent?tab=doc) for complete API.\n\nConfiguration\n-------------\n\nAll values have sensible defaults, so you can run Rain with an empty config but if you want to customize it's behavior,\nyou can pass a YAML config with `-config` flag. Config keys must be in lowercase.\nSee the description of values in here: [config.go](https://github.com/cenkalti/rain/blob/master/torrent/config.go)\n\nDifference from other clients\n-----------------------------\n\nRain is the main BitTorrent client used at [put.io](putio-link).\nIt is designed to handle hundreds of torrents while using low system resources.\nOne notable difference from other clients is that Rain uses a separate peer port for each torrent.\nThis allows Rain to download same torrent for multiple accounts in same private tracker and keep reporting their ratio correctly.\n\nMissing features\n----------------\n\nThe 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](putio-link), 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.\n\n- [IPv6 tracker extension](http://bittorrent.org/beps/bep_0007.html)\n- [IPv6 extension for DHT](http://bittorrent.org/beps/bep_0032.html)\n- [uTorrent transport protocol](http://bittorrent.org/beps/bep_0029.html)\n- [Superseeding](http://bittorrent.org/beps/bep_0016.html)\n- [HTTP seeding](http://bittorrent.org/beps/bep_0017.html)\n- [Merkle tree torrent extension](http://bittorrent.org/beps/bep_0030.html)\n- uPnP port forwarding\n- Selective downloading\n- Sequential downloading\n\nContributing\n------------\n\nRain is primarily developed to serve the specific requirements of [put.io](putio-link). 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.\n\nStar History\n------------\n\n[![Star History Chart](https://api.star-history.com/svg?repos=cenkalti/rain\u0026type=Date)](https://star-history.com/#cenkalti/rain\u0026Date)\n\n[putio-link]: https://put.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcenkalti%2Frain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcenkalti%2Frain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcenkalti%2Frain/lists"}