Commit f3c9ad13 authored by Alexandre Pere's avatar Alexandre Pere

Removes Remote leak

parent 893ca573
[package]
name = "remote-leak"
version = "0.2.0"
authors = ["Alexandre Péré <alexandre.pere@protonmail.com>"]
edition = "2018"
[dependencies]
futures-preview = "0.3.0-alpha.17"
liborchestra = { path = "../liborchestra"}
\ No newline at end of file
#![feature(async_await, futures_api)]
extern crate liborchestra;
use liborchestra::ssh;
use std::alloc::System;
#[global_allocator]
static GLOBAL: System = System;
fn main(){
use futures::executor::block_on;
for i in 1..100{
async fn connect_and_ls() {
let profile = ssh::config::SshProfile{
name: "test".to_owned(),
hostname: Some("127.0.0.1".to_owned()),
user: Some("apere".to_owned()),
port: None,
proxycommand: Some("ssh -A -l apere localhost -W localhost:22".to_owned()),
};
let remote = ssh::RemoteHandle::spawn(profile).unwrap();
let output = remote.async_exec("echo kikou".to_owned()).await.unwrap();
println!("Executed and resulted in {:?}", String::from_utf8(output.stdout).unwrap());
}
println!("{}", i);
block_on(connect_and_ls());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment