百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

suppaftp

> 开发工具
开源

一个超级 FTP/FTPS 客户端库,适用于 Rust,提供对被动和主动模式的全面 RFC 支持

191 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个超级 FTP/FTPS 客户端库,适用于 Rust,提供对被动和主动模式的全面 RFC 支持

SuppaFTP

~ A super FTP/FTPS client library for Rust ~

Documentation · Crates.io

Developed by veeso


  • SuppaFTP
    • Introduction
      • Features ✨
    • Get started
      • Cargo features
        • SSL/TLS Support
        • Async support
        • Deprecated methods
        • Logging
      • Examples
        • Ftp with TLS (native-tls)
        • Ftp with TLS (rustls)
        • Going Async
    • Built-in CLI client ️
    • Changelog ⌛
    • License
      • Contribution

Introduction

SuppaFTP is a feature-rich FTP/FTPS client library for Rust, supporting both synchronous and asynchronous programming. It aims to be a complete, reliable and well-tested implementation of the FTP protocol for Rust developers.

Features ✨

  • FTPS support with your choice of TLS backend: native-tls or rustls
  • First-class sync and async APIs, with tokio and smol as async backends
  • ⬇️ Stream-based transfers (e.g. put_with_stream, retr_as_stream) returning a self-finalizing TransferStream: call finish() to check the transfer result; dropping it attempts cleanup
  • ↔️ Both passive and active transfer modes
  • Wide command coverage, including ABOR, APPE, REST, EPSV and EPRT
  • Built-in parser for the LIST command output (POSIX and DOS formats) into structured File objects
  • Helpers such as get_welcome_msg to access server greetings
  • Pure Rust with no mandatory C bindings (when using rustls)
  • Implements RFC 2428 and RFC 2389
  • Robust error handling and an extensive test suite with code coverage

Get started

To get started, first add suppaftp to your dependencies:

toml
suppaftp = "^11"

Cargo features

These are all the possible features, by family

  • Sync FTP:
    • native-tls: enable FTPS support using native-tls as backend for TLS
    • native-tls-vendored: enable vendored FTPS support using native-tls
    • rustls-aws-lc-rs: enable FTPS support using rustls with aws-lc-rs as TLS backend.
    • rustls-ring: enable FTPS support using rustls with ring as TLS backend.
  • Async FTP:
    • Smol:
      • smol: enable async client using smol as async backend
      • smol-async-native-tls: enable FTPS support using async-native-tls
      • smol-async-native-tls-vendored: enable vendored FTPS support using async-native-tls
      • smol-rustls-aws-lc-rs: enable FTPS support using rustls with aws-lc-rs as TLS backend.
      • smol-rustls-ring: enable FTPS support using rustls with ring as TLS backend.
    • Tokio:
      • tokio: enable async client using tokio as async backend
      • tokio-async-native-tls: enable FTPS support using async-native-tls
      • tokio-async-native-tls-vendored: enable vendored FTPS support using async-native-tls
      • tokio-rustls-aws-lc-rs: enable FTPS support using rustls with aws-lc-rs as TLS backend.
      • tokio-rustls-ring: enable FTPS support using rustls with ring as TLS backend.
  • Misc:
    • deprecated: enable deprecated FTP/FTPS methods
    • no-log: disable logging

In more details:

SSL/TLS Support

If you want to enable support for FTPS, you must enable the native-tls or one of the rustls features in your cargo dependencies, based on the TLS provider you prefer.

toml
suppaftp = { version = "^11", features = ["native-tls"] }
# or
suppaftp = { version = "^11", features = ["rustls-aws-lc-rs"] }

[!NOTE] If you don't know what to choose, native-tls should be preferred for compatibility reasons.
❗ If you want to link libssl statically, enable feature native-tls-vendored

Async support

If you want to enable async support, you must enable either smol feature, to use smol or tokio feature, to use tokio as backend, in your cargo dependencies.

toml
suppaftp = { version = "^11", features = ["tokio"] }

[!CAUTION] ⚠️ To enable both native-tls and smol, use the smol-async-native-tls feature ⚠️
⚠️ To enable both native-tls and tokio, use the tokio-async-native-tls feature ⚠️
⚠️ To enable both rustls and smol, use the smol-rustls-aws-lc-rs (or -ring) feature ⚠️
⚠️ To enable both rustls and tokio, use the tokio-rustls-aws-lc-rs (or -ring) feature ⚠️
❗ To link libssl statically with smol, enable feature smol-async-native-tls-vendored
❗ To link libssl statically with tokio, enable feature tokio-async-native-tls-vendored

Deprecated methods

If you want to enable deprecated methods of FTPS, please enable the deprecated feature in your cargo dependencies.

This feature enables these methods:

  • connect_secure_implicit(): used to connect via implicit FTPS

Logging

By default, the library will log if there is any log crate consumer on the user implementation. Logging can be if preferred, disabled via the no-log feature.

Examples

…

Ftp with TLS (native-tls)

rust
use suppaftp::native_tls::TlsConnector;
use suppaftp::{NativeTlsConnector, NativeTlsFtpStream};

fn main() {
    let ftp_stream = NativeTlsFtpStream::connect("test.rebex.net:21").unwrap();
    // Switch to the secure mode
    let mut ftp_stream = ftp_stream
        .into_secure(
            NativeTlsConnector::from(TlsConnector::new().unwrap()),
            "test.rebex.net",
        )
        .unwrap();
    ftp_stream.login("demo", "password").unwrap();
    // Do other secret stuff
    assert!(ftp_stream.quit().is_ok());
}

Ftp with TLS (rustls)

You can also find and run this example in the suppaftp/examples/ directory ( cargo run --example rustls --features rustls).

…

Going Async

…

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 crates/suppaftp-cli/ directory.

You can simply install as any other rust application via Cargo:

bash
cargo install suppaftp-cli
suppaftp --version

Changelog ⌛

View Changelog here


License

Licensed under either of

  • Apache License, Version 2.0, (LICENSE-APACHE or )
  • MIT license (LICENSE-MIT or )

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 .

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustasyncasync-ftpasynchronousftp

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具