A bittorrent client in Rust
rqbit is a bittorrent client written in Rust. Has HTTP API and Web UI, and can be used as a library.
Also has a desktop app built with Tauri.
Assuming you are downloading to ~/Downloads.
rqbit server start ~/DownloadsAssuming you are downloading to ~/Downloads. By default it'll download to current directory.
rqbit download [-o ~/Downloads] 'magnet:?....' [https?://url/to/.torrent] [/path/to/local/file.torrent]Access at http://localhost:3030/web/. See screenshot below (torrent names and speeds are simulated).
The desktop app is a thin wrapper on top of the Web UI frontend.
Download it in Releases for OSX and Windows. For Linux, build manually with
cargo tauri buildIt looks similar to the Web UI (screenshot above).
rqbit can stream torrent files and smartly block the stream until the pieces are available. The pieces getting streamed are prioritized. All of this allows you to seek and live stream videos for example.
You can also stream to e.g. VLC or other players with HTTP URLs. Supports seeking too (through various range headers). The streaming URLs look like http://IP:3030/torrents/<torrent_id>/stream/<file_id>
rqbit can advertise managed torrents to LAN, e.g. your TVs and stream torrents there (without transcoding). Seeking to arbitrary points in the videos is supported too.
Usage from CLI
rqbit --enable-upnp-server server start ...rqbit can advertise its HTTP API on your LAN via mDNS/DNS-SD, so you can open the Web UI at http://rqbit.local:3030/web/ from any device without knowing the server's IP.
Usage from CLI (requires a non-loopback listen address):
rqbit --enable-mdns --http-api-listen-addr 0.0.0.0:3030 server start ...rqbit supports IPv6. By default it listens on all interfaces in dualstack mode. It can work even if there's no IPv6 enabled.
Assuming bash, add this to your ~/.bashrc. Modify for your shell of choice.
eval "$(rqbit completions bash)"rqbit --socks-url socks5://[username:password]@host:port ...rqbit server start --watch-folder [path] /download/pathrqbit can be started on-demand via systemd socket activation by installing the service and socket systemd units into $XDG_CONFIG_HOME/systemd/user/ (~/.config/systemd/user) and customizing them to your needs. If the associated rqbit.conf file is installed in $XDG_CONFIG_HOME/rqbit/rqbit.conf (~/.config/rqbit/rqbit.conf), it will be used to configure rqbit when started via the provided systemd unit.
Anecdotally from a few reports, rqbit is faster than other clients they've tried, at least with their default settings.
Memory usage for the server is usually within a few tens of megabytes, which makes it great for e.g. RaspberryPI.
I've got a report that rqbit can saturate a 20Gbps link, although I don't have the hardware to confirm.
There are pre-built binaries in Releases.
rqbit can be installed using Homebrew.
brew install rqbitIf you have the Rust toolchain installed then you can use the following.
cargo install rqbitDocker images are published at ikatson/rqbit
Just a regular Rust binary build process.
cargo build --releaseThe "webui" feature requires npm installed.
Run rqbit --help to see all available CLI options.
Increase verbosity. Possible values: trace, debug, info, warn, error.
Will print the contents of the torrent file or the magnet link.
If you want to resume downloading a file that already exists, you'll need to add this option.
Use a regex here to select files by their names.
/metrics and /torrents/<id_or_infohash>/peer_stats/prometheusBy default it listens on http://127.0.0.1:3030.
…For HTTP API basic authentication set RQBIT_HTTP_BASIC_AUTH_USERPASS environment variable.
RQBIT_HTTP_BASIC_AUTH_USERPASS=username:password rqbit server start ...curl -d 'magnet:?...' http://127.0.0.1:3030/torrents
OR
curl -d 'http://.../file.torrent' http://127.0.0.1:3030/torrents
OR
curl --data-binary @/tmp/xubuntu-23.04-minimal-amd64.iso.torrent http://127.0.0.1:3030/torrents
Supported query parameters, all optional:
This project began purely out of my enjoyment of writing code in Rust. I wasn’t satisfied with my regular BitTorrent client and wanted to see how much effort it would take to build one from scratch. Starting with the bencode protocol, then the peer protocol, it gradually evolved into what it is today.
If you love rqbit, please consider donating through one of these methods. With enough support, I might be able to make this my full-time job one day — which would be amazing!
No open issues yet, or sync has not completed.