8 releases

0.2.5 May 16, 2024
0.2.4 Dec 24, 2023
0.2.3 Sep 16, 2023
0.2.2 Jan 25, 2023
0.1.0 Mar 26, 2021

#943 in Network programming

Download history 24/week @ 2024-07-21 50/week @ 2024-07-28 41/week @ 2024-08-04 68/week @ 2024-08-11 110/week @ 2024-08-18 55/week @ 2024-08-25 88/week @ 2024-09-01 77/week @ 2024-09-08 78/week @ 2024-09-15 128/week @ 2024-09-22 117/week @ 2024-09-29 68/week @ 2024-10-06 144/week @ 2024-10-13 95/week @ 2024-10-20 89/week @ 2024-10-27 108/week @ 2024-11-03

440 downloads per month
Used in 9 crates

Apache-2.0

410KB
8K SLoC

unftp-sbe-fs

Crate Version API Docs Crate License Follow on Telegram

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.20.0"
unftp-sbe-fs = "0.2.5"
tokio = { version = "1", features = ["full"] }

Now you're ready to develop your server! Add the following to src/main.rs:

use unftp_sbe_fs::ServerExt;

#[tokio::main]
pub async fn main() {
    let ftp_home = std::env::temp_dir();
    let server = libunftp::Server::with_fs(ftp_home)
        .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:

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

~24–36MB
~669K SLoC