SuppaFTP
Introduction 👋
SuppaFTP is a FTP/FTPS client library written in Rust, with both support for sync/async programming. It is a fork of the original ftp library "rust-ftp", but since the original library is currently unmaintened, I decided to keep working on this library by myself. Currently, I consider myself as the only maintainer of this project, indeed I've already added some features to the library and improved it with better error handling and test units. Then, feel free to use this library instead of the classic rust-ftp if you want, and if you have any feature request or issue to report, please open an issue on this repository; I will answer you as soon as possible.
Main differences between SuppaFTP and rust-ftp 🤔
- Added methods to work with streams (e.g.
put_with_stream
) ⬇️ - Added
get_welcome_msg
method 👋 - Supports for both sync/async rust
- Some extra features, such as the LIST command output parser
- Replaced openssl with native-tls 🔒
- Removed deprecated statements 👴
- Better error handling 🐛
- Added test units keeping an eye on code coverage 👀
Get started 🏁
To get started, first add suppaftp to your dependencies:
= "4.1.2"
Features
SSL/TLS Support
If you want to enable support for FTPS, you must enable the secure
feature in your cargo dependencies. FTPS support is achieved through rust-native-tls, so check if your target systems are compatible.
= { = "4.1.2", = ["secure"] }
Async support
If you want to enable async support, you must enable async
feature in your cargo dependencies.
= { = "4.1.2", = ["async"] }
⚠️ If you want to enable both secure and async you must use the async-secure feature ⚠️
Example 📚
extern crate suppaftp;
use str;
use Cursor;
use FtpStream;
Going Async
use FtpStream;
use ;
let ftp_stream = connect.await.unwrap;
// Switch to the secure mode
let mut ftp_stream = ftp_stream.into_secure.await.unwrap;
ftp_stream.login.await.unwrap;
// Do other secret stuff
// Do all public stuff
assert!;
Built-in CLI client 🖥️
SuppaFTP comes also with a built-in command line FTP client. This CLI application provides all the commands to interact with a remote FTP server and supports FTPS too. You can also use it as a reference to implement your project. You can find it in the cli/
directory.
You can just install as any other rust application via Cargo:
Buy me a coffee ☕
If you like SuppaFTP, please consider a little donation 🥳
Changelog
View Changelog here
License 📜
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution 🤝
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 dual licensed as above, without any additional terms or conditions.
If you want to contribute to this project, please read the Contributing guide first 🙂.