12 releases
Uses new Rust 2024
| 0.4.0 | Feb 16, 2026 |
|---|---|
| 0.3.0 | Apr 26, 2025 |
| 0.2.6 | Dec 15, 2024 |
| 0.2.5 | May 16, 2024 |
| 0.1.0 | Mar 26, 2021 |
#837 in Network programming
3,839 downloads per month
Used in 12 crates
75KB
954 lines
unftp-sbe-fs
This unftp-sbe-fs crate allows you to use a regular Filesystem with libunftp and work like a regular FTP server.
Getting started
If you've got Rust and cargo installed, create your project with
cargo new myftp
Add the libunftp and tokio crates to your project's dependencies in Cargo.toml.
[dependencies]
libunftp = "0.23.0"
unftp-sbe-fs = "0.4.0"
tokio = { version = "1", features = ["full"] }
Now you're ready to develop your server!
Add the following to src/main.rs:
use libunftp::ServerBuilder;
use unftp_sbe_fs::Filesystem;
#[tokio::main]
pub async fn main() {
let ftp_home = std::env::temp_dir();
let server = ServerBuilder::new(Box::new(move || Filesystem::new(ftp_home.clone()).unwrap()))
.greeting("Welcome to my FTP server")
.passive_ports(50000..=65535)
.build()
.unwrap();
server.listen("127.0.0.1:2121").await;
}
You can now run your server with cargo run and connect to localhost:2121 with your favourite FTP client e.g.:
lftp -p 2121 localhost
For more help refer to:
- the examples directory.
- the API Documentation.
- unFTP server, a server from the bol.com techlab that is built on top of libunftp.
Getting help and staying informed
Support is given on a best effort basis. You are welcome to engage us on the discussions page or create a Github issue.
You can also follow news and talk to us on Telegram
Contributing
Thank you for your interest in contributing to unftp-sbe-fs!
Please feel free to create a Github issue if you encounter any problems.
Want to submit a feature request or develop your own storage or authentication back-end? Then head over to our contribution guide (CONTRIBUTING.md).
License
You're free to use, modify and distribute this software under the terms of the Apache License v2.0.
Dependencies
~15–31MB
~377K SLoC