Skip to content

Commit

Permalink
wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity committed Aug 22, 2024
1 parent 6befbf7 commit 538d0d0
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions ic-agent/src/agent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,18 @@ impl Agent {
ingress_expiry: config.ingress_expiry.unwrap_or(DEFAULT_INGRESS_EXPIRY),
root_key: Arc::new(RwLock::new(IC_ROOT_KEY.to_vec())),
client: config.client.unwrap_or_else(|| {
Client::builder()
.use_rustls_tls()
.timeout(Duration::from_secs(360))
.build()
.expect("Could not create HTTP client.")
#[cfg(not(target_family = "wasm"))]
{
Client::builder()
.use_rustls_tls()
.timeout(Duration::from_secs(360))
.build()
.expect("Could not create HTTP client.")
}
#[cfg(all(target_family = "wasm", feature = "wasm-bindgen"))]
{
Client::new()
}
}),
route_provider: config
.route_provider
Expand Down

0 comments on commit 538d0d0

Please sign in to comment.