pub struct NetworkConfig { /* private fields */ }Expand description
Proxy, TLS, and network-status policy; defaults to direct connections and WebPKI roots.
Use crate::OpenNet::new_with_network_config for the engine default or
crate::OpenNet::create_ws_client_with_network_config for a client override.
Passing NetworkConfig::default() explicitly selects direct connections and
the built-in trust roots; clone an existing value when changing one setting.
Implementations§
Source§impl NetworkConfig
impl NetworkConfig
Sourcepub fn with_proxy(self, proxy: ProxyConfig) -> Self
pub fn with_proxy(self, proxy: ProxyConfig) -> Self
Replaces the proxy policy.
Sourcepub fn with_tls(self, tls: TlsConfig) -> Self
pub fn with_tls(self, tls: TlsConfig) -> Self
Replaces the target WSS TLS policy. HTTPS proxy TLS is configured
independently on ProxyConfig::https_connect.
Sourcepub fn with_network_status_policy(self, policy: NetworkStatusPolicy) -> Self
pub fn with_network_status_policy(self, policy: NetworkStatusPolicy) -> Self
Selects how connections respond to network-monitor state changes.
The default is NetworkStatusPolicy::Ignore.
Sourcepub fn proxy(&self) -> &ProxyConfig
pub fn proxy(&self) -> &ProxyConfig
Returns the current proxy policy by reference without exposing credentials.
Sourcepub fn network_status_policy(&self) -> NetworkStatusPolicy
pub fn network_status_policy(&self) -> NetworkStatusPolicy
Returns the policy used when monitor reachability changes.