Skip to content

How can I customize the settings on the hyper client used by the SDK? #448

Answered by jdisanti
jdisanti asked this question in Q&A
Discussion options

You must be logged in to vote

As of version 0.6.0 of the SDK, the hyper client settings can be customized by manually creating a connector with aws_smithy_client::hyper_ext::Builder:

// Load credentials from the environment as usual
let shared_config = aws_config::load_from_env().await;

// Create a connector with the underlying hyper client customized
let conn = aws_smithy_client::hyper_ext::Builder::default()
    .hyper_builder({
        let mut builder = hyper::Client::builder();
        // Customize the hyper client here with the builder methods on 
        // https://docs.rs/hyper/0.14.17/hyper/client/struct.Builder.html
        // For example:
        // builder.pool_idle_timeout(None);
        builder
    })
    

Replies: 1 comment

Comment options

jdisanti
Feb 15, 2022
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by Velfi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant