pub struct ClientBuilder { /* private fields */ }Expand description
Build a Client.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new(url: impl Into<RelayUrl>) -> Self
pub fn new(url: impl Into<RelayUrl>) -> Self
Create a new ClientBuilder
Sourcepub fn server_url(self, url: impl Into<RelayUrl>) -> Self
pub fn server_url(self, url: impl Into<RelayUrl>) -> Self
Sets the server url
Sourcepub fn protocol(self, protocol: Protocol) -> Self
pub fn protocol(self, protocol: Protocol) -> Self
Sets whether to connect to the relay via websockets or not. Set to use non-websocket, normal relaying by default.
Sourcepub fn address_family_selector<S>(self, selector: S) -> Self
pub fn address_family_selector<S>(self, selector: S) -> Self
Returns if we should prefer ipv6 it replaces the relayhttp.AddressFamilySelector we pass It provides the hint as to whether in an IPv4-vs-IPv6 race that IPv4 should be held back a bit to give IPv6 a better-than-50/50 chance of winning. We only return true when we believe IPv6 will work anyway, so we don’t artificially delay the connection speed.
Sourcepub fn insecure_skip_cert_verify(self, skip: bool) -> Self
Available on crate feature test-utils only.
pub fn insecure_skip_cert_verify(self, skip: bool) -> Self
test-utils only.Skip the verification of the relay server’s SSL certificates.
May only be used in tests.
Sourcepub fn proxy_url(self, url: Url) -> Self
pub fn proxy_url(self, url: Url) -> Self
Set an explicit proxy url to proxy all HTTP(S) traffic through.
Sourcepub fn key_cache_capacity(self, capacity: usize) -> Self
pub fn key_cache_capacity(self, capacity: usize) -> Self
Set the capacity of the cache for public keys.
Sourcepub fn server_public_key(self, server_public_key: PublicKey) -> Self
pub fn server_public_key(self, server_public_key: PublicKey) -> Self
The expected [PublicKey] of the relay server we are connecting to.