diff --git a/common/http-api-client/Cargo.toml b/common/http-api-client/Cargo.toml index 66c0f94695..e542474516 100644 --- a/common/http-api-client/Cargo.toml +++ b/common/http-api-client/Cargo.toml @@ -14,6 +14,7 @@ license.workspace = true default=["tunneling"] tunneling=[] network-defaults = ["dep:nym-network-defaults"] +force-ipv4 = [] [dependencies] async-trait = { workspace = true } @@ -50,3 +51,4 @@ features = ["tokio"] [dev-dependencies] tokio = { workspace = true, features = ["rt", "macros"] } + diff --git a/common/http-api-client/src/lib.rs b/common/http-api-client/src/lib.rs index 883c7e7b3f..9d54099173 100644 --- a/common/http-api-client/src/lib.rs +++ b/common/http-api-client/src/lib.rs @@ -512,9 +512,11 @@ impl ClientBuilder { .deflate(true) .brotli(true) .zstd(true) - .local_address(IpAddr::from_str("0.0.0.0").unwrap()) }; + #[cfg(feature = "force-ipv4")] + let reqwest_client_builder = reqwest_client_builder.local_address(IpAddr::from_str("0.0.0.0").unwrap()); + ClientBuilder { urls, timeout: None,