diff --git a/iroh-net/src/relay/http/client.rs b/iroh-net/src/relay/http/client.rs index 3ae609f30e..1768e70d45 100644 --- a/iroh-net/src/relay/http/client.rs +++ b/iroh-net/src/relay/http/client.rs @@ -31,6 +31,7 @@ use crate::key::{PublicKey, SecretKey}; use crate::relay::client::{ConnReader, ConnWriter}; use crate::relay::codec::DerpCodec; use crate::relay::http::streams::{downcast_upgrade, MaybeTlsStream}; +use crate::relay::http::RELAY_PATH; use crate::relay::RelayUrl; use crate::relay::{ client::Client as RelayClient, client::ClientBuilder as RelayClientBuilder, @@ -203,12 +204,14 @@ impl PingTracker { } /// Build a Client. +#[derive(derive_more::Debug)] pub struct ClientBuilder { /// Default is false can_ack_pings: bool, /// Default is false is_preferred: bool, /// Default is None + #[debug("address family selector callback")] address_family_selector: Option BoxFuture + Send + Sync + 'static>>, /// Default is false is_prober: bool, @@ -225,16 +228,6 @@ pub struct ClientBuilder { proxy_url: Option, } -impl std::fmt::Debug for ClientBuilder { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let address_family_selector_txt = match self.address_family_selector { - Some(_) => "Some(Box BoxFuture<'static, bool> + Send + Sync + 'static>)", - None => "None", - }; - write!(f, "ClientBuilder {{ can_ack_pings: {}, is_preferred: {}, address_family_selector: {address_family_selector_txt} }}", self.can_ack_pings, self.is_preferred) - } -} - impl ClientBuilder { /// Create a new [`ClientBuilder`] pub fn new(url: impl Into) -> Self { @@ -629,7 +622,7 @@ impl Actor { async fn connect_ws(&self) -> Result<(ConnReader, ConnWriter), ClientError> { let mut dial_url = (*self.url).clone(); - dial_url.set_path("/derp"); + dial_url.set_path(RELAY_PATH); // The relay URL is exchanged with the http(s) scheme in tickets and similar. // We need to use the ws:// or wss:// schemes when connecting with websockets, though. dial_url @@ -720,7 +713,7 @@ impl Actor { ); debug!("Sending upgrade request"); let req = Request::builder() - .uri("/derp") + .uri(RELAY_PATH) .header(UPGRADE, Protocol::Relay.upgrade_header()) .body(http_body_util::Empty::::new())?; request_sender.send_request(req).await.map_err(From::from)