veeso / suppaftp

a super FTP/FTPS client library for Rust with support for both passive and active mode
Apache License 2.0
121 stars 31 forks source link

[Feature Request] - Support active mode #4

Closed devbydav closed 2 years ago

devbydav commented 2 years ago

Description

suppaftp currently supports passive mode only, which is the most commonly used. Sometimes active mode is needed, for example with servers behind a firewall that doesn't open port for data connections.

I have already started implementing it because I needed it, but it would be great to add the feature to suppaftp! I will be happy to make any changes to fit in.

Changes

Support active mode

veeso commented 2 years ago

It's okay for me!

Regarding the implementation in the client structure, I would make a method like this

pub fn active_mode(mut self) -> Self {
    self.mode = Mode::Active;
    self
}

and by default mode is set to Mode::Passive

veeso commented 2 years ago

Merged into 0.4.2

Thanks again for the amazing contribution!