feat: terminal proxy
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
use anyhow::Result;
|
||||
use log::info;
|
||||
use ssh2::Channel;
|
||||
use std::io::Read;
|
||||
use std::path::PathBuf;
|
||||
use tokio::net::{TcpStream, ToSocketAddrs};
|
||||
@ -28,6 +29,11 @@ impl SshClient {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn open_channel(&mut self) -> Result<Channel> {
|
||||
let channel = self.session.channel_session()?;
|
||||
Ok(channel)
|
||||
}
|
||||
|
||||
pub async fn execute(&mut self, command: &str) -> Result<(i32, String)> {
|
||||
info!("Executing command: {}", command);
|
||||
let mut channel = self.session.channel_session()?;
|
||||
|
Reference in New Issue
Block a user