libunftp 0.6.0

Safe, fast and extensible FTP server library for Rust.
docs.rs failed to build libunftp-0.6.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: libunftp-0.19.1

libunftp

Crate Version Crate License Build Status API Docs

When you need to FTP, but don't want to.

logo

The libunftp library drives unFTP. Its a safe, fast and extensible FTP(S) server implementation in Rust brought to you by the bol.com techlab.

Because of its plug-able authentication and storage backends (e.g. local filesystem, Google Cloud Storage) it's more flexible than traditional FTP servers and a perfect match for the cloud.

It runs on top of the Tokio asynchronous run-time and tries to make use of Async IO as much as possible.

libunftp is currently under heavy development and not yet recommended for production use. The API MAY BREAK

API Documentation

Prerequisites

You'll need Rust 1.41 or higher to build libunftp.

Getting started

If you've got Rust and cargo installed, create your project with

cargo new myftp

Then add the libunftp, tokio & futures crates to your project's dependencies in Cargo.toml:

[dependencies]
libunftp = "0.6.0"
tokio-compat = { version = "0.1", features = ["rt-full"] }

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

use futures::future::Future;
use tokio_compat::runtime::Runtime;

fn main() {
    let ftp_home = std::env::temp_dir();
    let server = libunftp::Server::with_root(ftp_home)
        .greeting("Welcome to my FTP server")
        .passive_ports(50000..65535);

    let mut runtime = Runtime::new().unwrap();
    runtime.block_on_std(server.listener("127.0.0.1:2121"));
}

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:

Contributing

Thank you for your interest in contributing to libunftp!

Please feel free to create a github issue if you encounter any problems.

Want to submit a feature request? 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.