Skip to main content

Crate turn_client_proto

Crate turn_client_proto 

Source
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. (D)TLS functionality is contained within extension crates. e.g.

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;
use turn_client_proto::api::TurnConfig;
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 config = TurnConfig::new(credentials);

let client = TurnClientUdp::allocate(
    local_address,
    turn_server_address,
    config,
);

Re-exports§

pub use stun_proto as stun;
pub use turn_types as types;

Modules§

api
TURN client API.
client
TURN Client.
prelude
Public prelude.
tcp
TCP TURN client.
udp
UDP TURN client.

Macros§

impl_client
Implement an enum over a list of TURN client implementations.