cloud-storage-rs icon indicating copy to clipboard operation
cloud-storage-rs copied to clipboard

Add ClientBuilder and support a configureable reqwest client

Open alexpusch opened this issue 3 years ago • 0 comments

cloud-storage-rs uses a default Reqwest client as its internal http client. Reqwest offers a large set of configuration that are inaccessible to cloud-storage-rs users.

This PR adds a ClientBuilder struct which enables to customize reqwest client

Example usage:

        let builder = Client::builder();
        let custom_client = reqwest::Client::builder()
            .timeout(core::time::Duration::from_secs(10))
            .build()?;

        let client = builder.with_reqwest_client(custom_client).build();

There are many use cases for providing a custom client:

  • configuring proxy servers
  • configuring timeouts, keepalive settings
  • configuring custom http2 optimizations, or opt out to http1

alexpusch avatar Aug 26 '22 18:08 alexpusch