Skip to content

ystreet/turn-proto

Repository files navigation

Build status codecov Dependencies crates.io docs.rs

turn-proto

Repository containing a sans-IO implementation of the TURN (RFC5766) protocol and STUN parsing and writing in the Rust programming language.

Why sans-io?

A couple of reasons: reusability, and testability.

Without being bogged down in the details of how IO happens, the same sans-IO implementation can be used without prescribing the IO pattern that an application must follow. Instead, the application (or parent library) has much more freedom in how bytes are transferred between peers. It is possible to use a sans-IO library in either a synchronous or within an asynchronous runtime.

sans-IO also allows easy testing of any specific state the sans-IO implementation might find itself in. Combined with a comprehensive test-suite, this provides assurance that the implementation behaves as expected under all circumstances.

For other examples of sans-IO implementations, take a look at:

Relevant standards

  • RFC5766: Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)
  • 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)

Structure

Contains parsers and writing implementations for TURN related STUN messages and attributes. Message parsing is zero-copy by default.

turn-client-proto builds on top of turn-types and implements some of the TURN protocol requirements when communicating with a peer. It does this using a sans-IO API and thus does no networking calls of its own.

turn-server-proto builds on top of turn-types and implements a TURN server for communicating with TURN clients. It does this using a sans-IO API and thus does no networking calls of its own.

Rustls crypto providers

turn-client-proto and turn-server-proto do not enable any cryptographic providers on rustls. It is the user's responsibility (library or application) to enable and use the relevant cryptographic provider (ring, aws-lc-rs, RustCrypto, etc), that they wish to use.

Funding

Support for TURN has been funded in part through the NGI0 Commons Fund a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme.

About

A (sans-IO) implementation of the TURN (RFC5766) protocol written in Rust

Resources

Security policy

Stars

Watchers

Forks

Contributors

Languages