- Rust 99.3%
- Dockerfile 0.7%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| proto | ||
| src | ||
| .env.example | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Dockerfile | ||
| LICENSE | ||
| README.md | ||
| sonar-project.properties | ||
Senden voice and video relay
Note: This project is currently halted. Senden will use WebRTC for the foreseeable future. This is mostly due to incompatibility with browsers/clients.
Senden relay is a Rust relay server for forwarding voice and video between users in a call. It uses WebTransport (QUIC/HTTP3) for media transport. It can be operated as part of a self hosted Senden node in the future.
Prerequisites
- Rust installed https://rustup.rs
- A TLS certificate and key (required for WebTransport; see TLS setup)
If you would like to sponsor a node, please contact us at contact@wireway.ch.
First-time setup
1. Generate the API key
The relay uses a pre-shared key to authenticate requests from the backend. On first run, set SETUP_RELAYKEY to your chosen secret:
SETUP_RELAYKEY=your-secret-key cargo run
2. TLS setup
WebTransport requires a valid TLS certificate. You have two options:
Let certbot generate a certificate:
SETUP_TLS_DOMAIN=relay.example.com SETUP_TLS_EMAIL=you@example.com cargo run
This runs certbot certonly --standalone for the domain and prints the resulting cert paths. Certbot must be installed and port 80 must be open. After it completes, use the printed paths as CERT_PATH/KEY_PATH when starting the relay.
Use already existing certificate
Set CERT_PATH and KEY_PATH directly (see Environment variables).
Running
# Development
cargo run
# Production
cargo build --release
CERT_PATH=/path/to/cert.pem KEY_PATH=/path/to/key.pem ./target/release/senden-relay
You should configure a systemd job to run this. If you don't know how to do this, you should probably not host this.
Running tests
cargo test
Environment variables
| Variable | Default | Description |
|---|---|---|
PORT |
3000 |
HTTP/management API port |
WT_PORT |
4433 |
WebTransport (QUIC) port |
CERT_PATH |
- | Path to TLS certificate PEM file |
KEY_PATH |
- | Path to TLS private key PEM file |
RUST_LOG |
info |
Log level (trace, debug, info, warn, error) |
SETUP_RELAYKEY |
- | One-time: plain-text API key to hash and save |
SETUP_TLS_DOMAIN |
- | One-time: domain to obtain a Let's Encrypt cert for |
SETUP_TLS_EMAIL |
- | Optional email for Let's Encrypt registration |
API
All management endpoints require Authorization: Bearer <api-key> using the plain-text key set during first-time setup.
| Method | Path | Description |
|---|---|---|
GET |
/health |
Server health, uptime, active room count |
POST |
/v1/management/{room_id}/allocate |
Allocate a WebTransport token for a user |
DELETE |
/v1/management/{room_id} |
Delete a room and disconnect all participants |
DELETE |
/v1/management/{room_id}/users/{user_id} |
Remove a single user from a room |
GET |
/room/{room_id} |
List connected user IDs in a room |
In debug builds, a Swagger UI is available at http://localhost:3000/swagger-ui.