ClientBuilder

Struct ClientBuilder 

Source
pub struct ClientBuilder { /* private fields */ }
Available on (crate features rustls-tls or native-tls) and (crate features rustcrypto or openssl) only.
Expand description

Implementations§

Source§

impl ClientBuilder

Source

pub fn new() -> Self

Create a new builder with no options defined.

Source

pub fn with_rsa_key_size(self, num_bits: usize) -> Self

Sets the RSA key size that the builder will generate for the client.

Source

pub fn with_server(self, server: String) -> Self

Sets the Interactsh server that the client will connect to.

Source

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.

Source

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.

Source

pub fn with_timeout(self, timeout: Duration) -> Self

Sets the timeout value for server requests.

Source

pub fn verify_ssl(self, ssl_verify: bool) -> Self

Sets whether or not the client should verify the server’s SSL certificate.

Source

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.

Source

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.

Source

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

Source§

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CompatExt for T

Source§

fn compat(self) -> Compat<T>

Applies the Compat adapter by value. Read more
Source§

fn compat_ref(&self) -> Compat<&T>

Applies the Compat adapter by shared reference. Read more
Source§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the Compat adapter by mutable reference. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T