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: StringThe STUN server to use for Binding requests, as host:port. May be empty.
turn_serv_addr: StringThe TURN server to allocate from, as host:port.
local_addr: SocketAddrThe local address the client sends from.
transport_protocol: TransportProtocolWhether to reach the server over UDP or TCP.
username: StringThe 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: StringThe long-term credential password.
realm: StringNot used: the realm is the one the server names in its 401 (RFC 8489 §9.2.5).
software: StringThe 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: boolWhether 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: u64The 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: RetransmissionConfigThe 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: boolThe 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”).