let mut local = stream.remote_addr_unpin().await?;
let mut remote = TcpStream::connect("myip:22").await.context("could not connect to remote")?;
tokio::io::copy_bidirectional(&mut local, &mut remote).await.context("copying streams")?;
impl <'a, T> AsyncWrite for PPPRefStream<'a, T> where T: AsyncWrite {
fn poll_write(
self: Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
buf: &[u8],
) -> std::task::Poll<std::result::Result<usize, std::io::Error>> {
let this = self.get_mut();
this.inner.as_mut().poll_write(cx, buf)
}
fn poll_flush(self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> std::task::Poll<std::result::Result<(), std::io::Error>> {
let this = self.get_mut();
this.inner.as_mut().poll_flush(cx)
}
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> std::task::Poll<std::result::Result<(), std::io::Error>> {
let this = self.get_mut();
this.inner.as_mut().poll_shutdown(cx)
}
}
ssh client error:
Bad packet length 1231976033.
rust app error:
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: copying streams
Caused by:
Connection reset by peer (os error 104)', src/main.rs:55:34