pub struct ClientBuilder { /* private fields */ }Expand description
Builder for Client.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn accept_invalid_certs(self, accept: bool) -> Self
pub fn accept_invalid_certs(self, accept: bool) -> Self
Accept self-signed / invalid TLS certificates. Defaults to true
because the Gateway ships with a self-signed cert; set to false
once you install a trusted cert.
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Request timeout for every HTTP call (defaults to 30s).
Sourcepub fn user_agent(self, ua: impl Into<String>) -> Self
pub fn user_agent(self, ua: impl Into<String>) -> Self
Override the User-Agent header (defaults to bezant/<version>).
Sourcepub fn follow_redirects(self, follow: bool) -> Self
pub fn follow_redirects(self, follow: bool) -> Self
Follow HTTP redirects automatically. Defaults to true (reqwest’s
normal 10-hop policy). Set to false when you’re operating as a
reverse proxy and want 3xx responses passed through to the caller —
otherwise the browser ends up seeing the redirected body at the
original URL, which breaks relative asset paths on pages like
CPGateway’s /sso/Login.
Sourcepub fn http1_only(self, http1_only: bool) -> Self
pub fn http1_only(self, http1_only: bool) -> Self
Force HTTP/1.1 only (no ALPN upgrade to HTTP/2). Defaults to true
because IBKR fronts the CPAPI with an Akamai CDN that rejects
empty-body POSTs shipped over HTTP/2 with 411 Length Required.
Flip this to false if you’re targeting a Gateway deployment that
does not sit behind Akamai (e.g. a self-hosted instance) and you
want the latency benefits of HTTP/2.
Trait Implementations§
Source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
Source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClientBuilder
impl Debug for ClientBuilder
Source§impl Default for ClientBuilder
impl Default for ClientBuilder
Source§fn default() -> Self
fn default() -> Self
Create a builder pointed at DEFAULT_BASE_URL — the
local Docker setup. Override via ClientBuilder::new when
you target a non-default Gateway address.