Skip to main content

ClientConfig

Struct ClientConfig 

Source
pub struct ClientConfig {
Show 14 fields pub stun_serv_addr: String, pub turn_serv_addr: String, pub local_addr: SocketAddr, pub transport_protocol: TransportProtocol, pub username: String, pub password: String, pub realm: String, pub software: String, pub software_in_indications: bool, pub rto_in_ms: u64, pub retransmission: RetransmissionConfig, pub password_algorithms: Vec<u16>, pub allocation_refresh_interval_cap: Option<Duration>, pub username_anonymity_required: bool,
}
Expand description

ClientConfig is a bag of config parameters for Client.

Fields§

§stun_serv_addr: String

The STUN server to use for Binding requests, as host:port. May be empty.

§turn_serv_addr: String

The TURN server to allocate from, as host:port.

§local_addr: SocketAddr

The local address the client sends from.

§transport_protocol: TransportProtocol

Whether to reach the server over UDP or TCP.

§username: String

The long-term credential username for the TURN server. It is sent as USERNAME, or hashed as USERHASH when the server’s nonce says it supports that (RFC 8489 §9.2.5).

§password: String

The long-term credential password.

§realm: String

Not used: the realm is the one the server names in its 401 (RFC 8489 §9.2.5).

§software: String

The SOFTWARE attribute of every request (RFC 8489 Section 6.1: requests “SHOULD” carry one; Section 16.1.2: its use “SHOULD” be configurable). The default is DEFAULT_SOFTWARE (rtci-turn and its version); empty sends none, for an application that would not tell its software to the path.

§software_in_indications: bool

Whether Send indications carry ClientConfig::software too (RFC 8489 Section 6.1: “Indications MAY include a SOFTWARE attribute”). Off by default: Send indications are the relayed data path, and the attribute would cost its bytes on every packet sent before a channel is bound, for no effect on the protocol. Nothing is added when software is empty.

§rto_in_ms: u64

The initial retransmission timeout in milliseconds; each retransmission doubles the wait. 0 selects the default, the 500 ms RFC 8489 §6.2.1 asks for at least.

§retransmission: RetransmissionConfig

The rest of the retransmission timer: Rc, Rm, Ti, the RTO estimate and the number of outstanding transactions.

§password_algorithms: Vec<u16>

The password algorithms accepted from the server’s PASSWORD-ALGORITHMS (stun::password_algorithm), the first of the server’s list that is in here being used. Empty for all the client implements, SHA-256 and MD5. Without MD5, a server that offers no list (RFC 5389) or MD5 alone is not authenticated to: RFC 8489 §18.5.1.1 keeps MD5 for such servers only.

§allocation_refresh_interval_cap: Option<Duration>

Optional upper bound for the interval between allocation Refresh requests.

By default, allocations are refreshed at half the lifetime advertised by the server. A shorter cap can also keep the client-to-server NAT mapping active when an allocation waits without carrying application traffic. Values below one second are rounded up.

§username_anonymity_required: bool

The user name reveals the user and this connection to the server is not (D)TLS: it is sent only as USERHASH, and a server that does not offer USERHASH gets no request with the credential (RFC 8656 §21.1.6: “If the username reveals the identity of the user, the client MUST use the USERHASH attribute … or use (D)TLS”).

Trait Implementations§

Source§

impl Default for ClientConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.