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-rsBuild Workspace
Compile the entire workspace in release mode:
bash
cd turn-rs
cargo build --releaseYou 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 atGET /metricson the API server (also enablesrpc).
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 --releaseAfter the compilation is complete, you can find the binary file in the target/release directory.