A pure Rust implementation of the turn server. Compared with coturn, the advantage is to provide better performance. Single-threaded decoding speed up to 5Gib/s, forwarding delay is less than 35 microseconds. However, it does not provide as rich as coturn feature support, this project is more focused on the core business, do not need to touch the complex configuration items, almost out of the box.
If you are not familiar with coturn configuration items and are annoyed by the complexity of coturn configuration items, then you should use this project, and similarly, if you want better performance performance and lower memory footprint, you can also use this project. turn-rs configuration is easy, and the external api is very simple, and is good enough for core business support.
If you have extensive standard support requirements for turn servers and need more integrated services and ecological support, then you should choose coturn.
- Only long-term authentication mechanisms are used.
- Static authentication lists can be used in configuration files.
- Only virtual ports are always allocated and no real system ports are occupied.
- The transport layer supports tcp and udp protocols, and supports binding multiple network cards or interfaces.
- The REST API can be used so that the turn server can proactively notify the external service of events and use external authentication mechanisms, and the external can also proactively control the turn server and manage the session.
First, Get the compiled binaries from github release.
Start with configuration file:
turn-server --config=/etc/turn-server/config.toml
Please check the example configuration file for details: turn-server.toml
docker pull ghcr.io/mycrl/turn-server
The custom configuration file overrides the /etc/turn-server/config.toml
path inside the image through -v
.
./install-service.sh
This will compile the project and install and start the service.
You need to install the Rust toolchain, if you have already installed it, you can skip it, Install Rust, then get the source code:
git clone https://github.com/mycrl/turn-rs
Compile the entire workspace in release mode:
cd turn-rs
cargo build --release
After the compilation is complete, you can find the binary file in the "target/release"
directory.
GPL3.0 Copyright (c) 2022 Mr.Panda.