Closed Ch1nkara closed 1 year ago
Hi @Ch1nkara
Oh! Correct: I didn't tested it on windows, and as you noticed, the code needs to be fixed.
I rebuilt with this code instead, and it worked fine (if it can helps)
let mut child;
if cfg!(target_os = "windows") {
child = Command::new("cmd")
.args(["/C", &commandline])
.stdout(Stdio::piped())
.stdin(Stdio::piped())
.spawn()
.context("Error in launch proxycommand")?;
} else {
child = Command::new("/bin/sh")
.arg("-c")
.arg(&commandline)
.stdout(Stdio::piped())
.stdin(Stdio::piped())
.spawn()
.context("Error in launch proxycommand")?;
}
info!("Proxycommand {:?}", child);
Nice! Tell me if you are ok with the pr #118 to fix this: The only difference is that the distinction between os is done in a structure creation.
Your solution is cleaner !
Hello,
To my understanding, it is not yet possible to do the equivalent to
sanzu_client 127.0.0.1 1337 --proxycommand "ssh rochefort DISPLAY=:1234 sanzu_server --stdio"
on a windows client, due to the client.rs proxycommand handling (via
SHELL_PATH: &str = "/bin/sh";
, among other things). Is it correct or did I miss something ? So far, I've used the proxycommand on Linux clients, but I had to manually build a ssh tunnel on windows clients to do the equivalent.Thanks for your amazing work !