Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH support #117

Closed
IamTheCarl opened this issue May 13, 2021 · 3 comments
Closed

SSH support #117

IamTheCarl opened this issue May 13, 2021 · 3 comments

Comments

@IamTheCarl
Copy link

I have some shell scripts that control docker on a remote system using an ssh connection to that machine.
I'd like to upgrade those shell scripts to Rust.

I understand that making ssh2 a required dependency of this project can be cumbersome since most people aren't using this feature.
Could permitting the library to communicate over a generic reader/writer work?
That's something I'd be willing to work with.

@eldesh
Copy link
Collaborator

eldesh commented May 20, 2021

Are you planning to add the following parameters?

impl Docker {
  //  `R` and `W` may be wrapped into ssh tunnel
  fn new_from_reader_writer<R:Reader, W:Writer>(r:R, w:W, protocol: Protocol) ->Docker { .. }
}

@IamTheCarl
Copy link
Author

Yes. This exactly what I have in mind.
That'll let you use this over any reliable stream.

@eldesh
Copy link
Collaborator

eldesh commented May 25, 2021

If implemented as above, the reader/writer would need to be wrapped in HyperClient.
Then, the following form may be more preferable.

// pseudo code
let http: HyperClient = HyperClient::with_rw(rd, wr)?;
let docker = Docker::new(http, Unix)?

@eldesh eldesh closed this as completed Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants