pub struct ClientBuilder { /* private fields */ }rustls-tls or native-tls) and (crate features rustcrypto or openssl) only.Expand description
Builds an UnregisteredClient
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn with_rsa_key_size(self, num_bits: usize) -> Self
pub fn with_rsa_key_size(self, num_bits: usize) -> Self
Sets the RSA key size that the builder will generate for the client.
Sourcepub fn with_server(self, server: String) -> Self
pub fn with_server(self, server: String) -> Self
Sets the Interactsh server that the client will connect to.
Sourcepub fn with_auth_token(self, auth_token: String) -> Self
pub fn with_auth_token(self, auth_token: String) -> Self
Sets an optional auth token that the client will use to authenticate with the Interactsh server.
If this is not set, then no auth header will be sent to the server.
Sourcepub fn with_proxy(self, proxy: Proxy) -> Self
pub fn with_proxy(self, proxy: Proxy) -> Self
Sets an optional proxy that the client can use.
This can be set more than once; each new proxy will be added to a list of proxies that the client will try. Proxies will be tried in the order added.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sets the timeout value for server requests.
Sourcepub fn verify_ssl(self, ssl_verify: bool) -> Self
pub fn verify_ssl(self, ssl_verify: bool) -> Self
Sets whether or not the client should verify the server’s SSL certificate.
Sourcepub fn parse_logs(self, parse_logs: bool) -> Self
pub fn parse_logs(self, parse_logs: bool) -> Self
Sets whether or not the client should parse the logs or just return the raw logs.
Sourcepub fn set_dns_override(self, server_ip_address: IpAddr) -> Self
pub fn set_dns_override(self, server_ip_address: IpAddr) -> Self
Sets an option on the client to override normal DNS resolution for the server and instead use the provided IP address.
Sourcepub fn build(self) -> Result<UnregisteredClient, ClientBuildError>
pub fn build(self) -> Result<UnregisteredClient, ClientBuildError>
Builds an UnregisteredClient.
The server must be set and the RSA key generated in order for this to succeed. If the build succeeds, the register function must be called on the returned UnregisteredClient to turn it into a RegisteredClient.
Trait Implementations§
Source§impl Default for ClientBuilder
impl Default for ClientBuilder
Source§fn default() -> Self
fn default() -> Self
Create a new builder with the default options.
This will create a builder with a 2048 bit RSA key and server randomly picked from the list of default servers provided and maintained by the Interactsh team. This will also set the timeout to 15 seconds, SSL verification to false, and parse_logs to true.