Loading crates/arti-client/examples/hook-tcp.rs +1 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ use tokio_crate as tokio; use tor_rtcompat::tokio::TokioNativeTlsRuntime; use futures::{AsyncRead, AsyncWrite, FutureExt, Stream}; use tor_rtcompat::tls::NativeTlsProvider; use tor_rtcompat::{CompoundRuntime, TcpListener, TcpProvider}; use futures::io::{AsyncReadExt, AsyncWriteExt}; Loading @@ -31,7 +30,7 @@ async fn main() -> Result<()> { // Instantiate our custom TCP provider (see implementation below). let tcp_rt = CustomTcpProvider { inner: rt.clone() }; // Create a `CompoundRuntime`, swapping out the TCP part of the runtime for our custom one. let rt = CompoundRuntime::new(rt.clone(), rt, tcp_rt, NativeTlsProvider::default()); let rt = CompoundRuntime::new(rt.clone(), rt.clone(), tcp_rt, rt); eprintln!("connecting to Tor..."); let tor_client = TorClient::create_bootstrapped(rt, config).await?; Loading Loading
crates/arti-client/examples/hook-tcp.rs +1 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ use tokio_crate as tokio; use tor_rtcompat::tokio::TokioNativeTlsRuntime; use futures::{AsyncRead, AsyncWrite, FutureExt, Stream}; use tor_rtcompat::tls::NativeTlsProvider; use tor_rtcompat::{CompoundRuntime, TcpListener, TcpProvider}; use futures::io::{AsyncReadExt, AsyncWriteExt}; Loading @@ -31,7 +30,7 @@ async fn main() -> Result<()> { // Instantiate our custom TCP provider (see implementation below). let tcp_rt = CustomTcpProvider { inner: rt.clone() }; // Create a `CompoundRuntime`, swapping out the TCP part of the runtime for our custom one. let rt = CompoundRuntime::new(rt.clone(), rt, tcp_rt, NativeTlsProvider::default()); let rt = CompoundRuntime::new(rt.clone(), rt.clone(), tcp_rt, rt); eprintln!("connecting to Tor..."); let tor_client = TorClient::create_bootstrapped(rt, config).await?; Loading