diff --git a/src/client.rs b/src/client.rs index 8f9712e..9d52012 100644 --- a/src/client.rs +++ b/src/client.rs @@ -51,7 +51,8 @@ impl Client { alternative_hosts: Vec, account_id: AccountId, user_agent: &str, - network_interface: Option<&str>, + #[cfg(not(target_os = "windows"))] network_interface: Option<&str>, + #[cfg(target_os = "windows")] network_interface: Option, resolver_fallback_cache: Option>, ) -> anyhow::Result { let mut base_url = base_url.to_string(); @@ -88,7 +89,8 @@ impl Client { fn http_client_builder( user_agent: &str, rustls_config: rustls::ClientConfig, - network_interface: Option<&str>, + #[cfg(not(target_os = "windows"))] network_interface: Option<&str>, + #[cfg(target_os = "windows")] network_interface: Option, resolver_fallback_cache: Arc, ) -> anyhow::Result { let builder = ClientBuilder::new() @@ -99,7 +101,10 @@ impl Client { .dns_resolver(resolver_fallback_cache); let builder = match network_interface { None => builder, + #[cfg(not(target_os = "windows"))] Some(network_interface) => builder.interface(network_interface), + #[cfg(target_os = "windows")] + Some(network_interface) => builder.local_address(network_interface), }; builder.build().context("failed to initialize HTTP client") }