Skip to content

Build

Prerequisites

You need to install the Rust toolchain, if you have already installed it, you can skip it, Install Rust, then get the source code:

bash
git clone https://github.com/mycrl/turn-rs

Build Workspace

Compile the entire workspace in release mode:

bash
cd turn-rs
cargo build --release

You can enable target CPU optimizations, which will enable optimizations based on your current CPU. This can be easily enabled by adding an environment variable before compiling:

bash
export RUSTFLAGS='-C target-cpu=native'

Features

If you don't need a particular feature, you can reduce the package size by enabling only the features you require.

  • udp - Enables UDP transport layer support.
  • tcp - Enables TCP transport layer support.
  • rpc - Enable the gRPC rpc server feature.
  • prometheus - Enable Prometheus metrics at GET /metrics on the API server (also enables rpc).

NOTE

TLS is available on the management API (rpc.ssl) and the hook client (hooks.ssl).

All listed features are enabled by default.

bash
cargo build --release

After the compilation is complete, you can find the binary file in the target/release directory.

Released under the MIT License.