Add Tunnel::new_with_ipr, re-export IpPair/Recipient, tidy examples

- Add Tunnel::new_with_ipr() for targeting a specific exit node
- Re-export IpPair and Recipient so users don't need direct deps
- Add DNS leak warning to WebSocket example
- Await hyper connection task in HTTPS example
This commit is contained in:
mfahampshire
2026-03-25 00:20:22 +00:00
parent b205744da5
commit 781d3ee8d0
4 changed files with 29 additions and 5 deletions
+5 -1
View File
@@ -59,7 +59,7 @@ async fn main() -> Result<(), BoxError> {
// Hand the TLS stream to hyper for proper HTTP/1.1 handling.
let (mut sender, conn) = hyper::client::conn::http1::handshake(TokioIo::new(tls)).await?;
tokio::spawn(conn);
let conn_handle = tokio::spawn(conn);
let req = Request::get(path)
.header("Host", host)
@@ -94,6 +94,10 @@ async fn main() -> Result<(), BoxError> {
let slowdown = mixnet_duration.as_millis() as f64 / clearnet_duration.as_millis().max(1) as f64;
info!(" Slowdown: {slowdown:.1}x");
// Drop the sender so hyper knows we're done, then wait for the connection task.
drop(sender);
let _ = conn_handle.await;
tunnel.shutdown().await;
Ok(())
}