Expand description
§turn-client-proto
turn-client-proto provides a sans-IO API for a TURN client communicating with a TURN server.
Relevant standards:
- RFC5766: Traversal Using Relays around NAT (TURN).
- RFC6062: Traversal Using Relays around NAT (TURN) Extensions for TCP Allocations
- RFC6156: Traversal Using Relays around NAT (TURN) Extension for IPv6
- RFC8656: Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)
§Getting Started
The entry point for starting with a TURN client implementation depends on the transport
protocol that you are looking to use. For UDP connections, you should start in the udp
module, for TCP connections, the tcp module, for TLS connections, the rustls module
(when the rustls feature is enabled), or the openssl module (when the openssl feature
is enabled.
From there, the api module provides the interface that all of the TURN clients implement and
the client module can be used to combine one of the above options into a single value for
selection based on the underlying TURN client.
§Examples
use turn_client_proto::udp::TurnClientUdp;
let turn_server_address = "127.0.0.1:3478".parse().unwrap();
let local_address = "127.0.0.1:1000".parse().unwrap();
let credentials = turn_types::TurnCredentials::new("username", "password");
let client = TurnClientUdp::allocate(
local_address,
turn_server_address,
credentials,
&[turn_types::AddressFamily::IPV4]
);Re-exports§
pub use stun_proto as stun;pub use turn_types as types;