| Crates.io | fx-torrent |
| lib.rs | fx-torrent |
| version | 0.3.0 |
| created_at | 2025-12-27 19:59:10.36571+00 |
| updated_at | 2026-01-09 18:37:45.907528+00 |
| description | FX Torrent is a feature rich Bittorrent protocol implementation written in rust supporting Linux, MacOS and Windows. |
| homepage | |
| repository | https://github.com/yoep/fx-torrent |
| max_upload_size | |
| id | 2007728 |
| size | 1,414,576 |
FX-Torrent is the most complete BitTorrent implementation fully written in Rust, which supports both Linux, MacOS, and Windows.
It supports most of the Bittorrent protocol specifications, such as multi-file torrents, validating existing files, resuming torrent files,
and is based on the libtorrent library for functionality and naming convention.
To use the fx-torrent library, add the following cargo dependency:
Cargo.toml
[dependencies]
fx-torrent = "0.3.0"
Next, create a new FXTorrentSession which manages one or more torrents.
A Torrent can be created from a magnet link, torrent file, or passing the raw TorrentMetadata.
create a new session with torrent
use fx_torrent::torrents::{FxTorrentSession, TorrentFlags};
// The fx-torrent crate makes use of async tokio runtimes
// this requires that new sessions and torrents need to be created within an async context
#[tokio::main]
async fn main() -> Result<(), io::Error> {
let session = FxTorrentSession::builder()
.base_path("/torrent/location/directory")
.client_name("MyClient")
.build()
.unwrap();
// Create a torrent from a magnet link
let magnet_torrent = session.session.add_torrent_from_uri("magnet:?XXX", TorrentFlags::default()).await;
// Create a torrent from a torrent file
let file_torrent = session.session.add_torrent_from_uri("/tmp/example.torrent", TorrentFlags::default()).await;
Ok(())
}
For more examples, see the examples.
The CLI example can be used to download torrents from a magnet link or torrent file. It uses Ratatui as the terminal UI library.


This project is licensed under the Apache-2.0 license.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.