pub struct ReverseSshClient { /* private fields */ }Expand description
Reverse SSH client that establishes a reverse tunnel
Implementations§
Source§impl ReverseSshClient
impl ReverseSshClient
Sourcepub fn new(config: ReverseSshConfig) -> Self
pub fn new(config: ReverseSshConfig) -> Self
Create a new reverse SSH client with the given configuration
Sourcepub async fn connect(
&mut self,
tx: UnboundedSender<(Channel<Msg>, String, u32)>,
message_tx: UnboundedSender<String>,
) -> Result<()>
pub async fn connect( &mut self, tx: UnboundedSender<(Channel<Msg>, String, u32)>, message_tx: UnboundedSender<String>, ) -> Result<()>
Connect to the SSH server and authenticate
Sourcepub async fn setup_reverse_tunnel(&mut self) -> Result<()>
pub async fn setup_reverse_tunnel(&mut self) -> Result<()>
Set up a reverse port forward (remote port forwarding) This makes the SSH server listen on a port and forward connections back to us
Sourcepub async fn read_server_messages(&mut self) -> Result<Vec<String>>
pub async fn read_server_messages(&mut self) -> Result<Vec<String>>
Read server messages (useful for services like localhost.run that send URL info) This opens a session channel and attempts to read any messages from the server
Sourcepub async fn handle_forwarded_connections(
&mut self,
rx: UnboundedReceiver<(Channel<Msg>, String, u32)>,
) -> Result<()>
pub async fn handle_forwarded_connections( &mut self, rx: UnboundedReceiver<(Channel<Msg>, String, u32)>, ) -> Result<()>
Handle forwarded connections from the SSH server
Auto Trait Implementations§
impl Freeze for ReverseSshClient
impl RefUnwindSafe for ReverseSshClient
impl Send for ReverseSshClient
impl Sync for ReverseSshClient
impl Unpin for ReverseSshClient
impl UnwindSafe for ReverseSshClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more