Documentation Index
Fetch the complete documentation index at: https://voxray-cac3ed72.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Pre-launch checklist
Work through every item before accepting live traffic. Each item links to the relevant section below.- TLS enabled — on-server (
tls_enable: true) or terminated at a reverse proxy -
server_api_keyset — protects/start,/webrtc/offer,/sessions/{id}/api/offer, and/ws -
cors_allowed_originsrestricted to your front-end domain(s) — never leave it empty for browser clients -
max_request_body_bytesset — 1 MiB (1048576) recommended; default is 256 KB -
log_level: "info"— do not ship"debug"to production; it logs raw audio metadata and internal state -
json_logs: true— required for structured log aggregation (Fluentd, Loki, CloudWatch) -
/metricsendpoint firewalled or access-controlled — Prometheus text output must not be publicly reachable - API keys in environment variables, not in
config.json— never commit secrets to git - Session store set to
"redis"for multi-instance deployments — the default"memory"store is per-process - Health and readiness probes configured in your load balancer or Kubernetes deployment
TLS configuration
Voxray supports two TLS modes: terminating TLS directly inside the Go server, or delegating termination to a reverse proxy. Both are fully supported in production; choose whichever fits your infrastructure.WebRTC media (RTP/SRTP) is always peer-to-peer. TLS on the Voxray server only secures the signaling path — the HTTP(S) exchange for
POST /webrtc/offer and POST /sessions/{id}/api/offer. Media encryption is handled by DTLS-SRTP inside the WebRTC stack regardless of your TLS setting.- On-server TLS
- Reverse proxy (nginx)
Set the three TLS fields in The same three fields can be set via environment variables instead of the config file:All three must be provided together. If
config.json and point them at your certificate and private key files. The server calls ListenAndServeTLS internally.tls_enable is true but either cert or key path is missing, the server will fail to start.Logging configuration
Voxray uses a structured logger whose behavior is controlled by two config keys.| Config key | Environment variable | Values | Default |
|---|---|---|---|
log_level | VOXRAY_LOG_LEVEL | "debug", "info", "warn", "error" | "info" |
json_logs | VOXRAY_JSON_LOGS | true / false (or 1 / 0) | false |
"debug"— logs per-audio-chunk events, pipeline state transitions, and raw frame types. Never use in production; generates extreme log volume and may expose timing metadata."info"— logs connection lifecycle events, session start/end, errors, and configuration summary at startup. Appropriate for production."warn"— logs unexpected but recoverable conditions. Use when log volume is a cost concern and you have good alerting on errors."error"— logs only failures. Not recommended as the default; silent on normal operation means you lose visibility into traffic patterns.
json_logs: true) emits one JSON object per line. Each line is independently parseable — no multi-line log stitching required. Compatible out-of-the-box with:
- Fluentd — use the
jsonparser; fields map directly - Grafana Loki — use
jsonpipeline stage in Promtail - AWS CloudWatch Logs Insights — JSON fields are queryable with
fields @message - Datadog — standard JSON log ingestion with automatic field extraction
Resource limits
The table below gives recommended starting values. Adjust based on observed memory and CPU metrics from/metrics after load testing.
| Concurrent sessions | Recommended memory | Recommended CPU | Notes |
|---|---|---|---|
| 1–10 | 256 MB | 0.5 vCPU | Development / low-traffic |
| 10–50 | 1 GB | 2 vCPU | Moderate production load |
| 50–200 | 4 GB | 4–8 vCPU | High-traffic; consider Redis for sessions |
| 200+ | Scale horizontally | Multiple instances | See horizontal scaling below |
pipeline_input_queue_cap(env:VOXRAY_PIPELINE_INPUT_QUEUE_CAP, default256) — buffer between transport read and pipeline. Increase under bursty input. When this queue fills, the reader blocks so Voxray does not grow unbounded memory.ws_write_coalesce_ms(env:VOXRAY_WS_WRITE_COALESCE_MS, default0) — when non-zero, batches WebSocket writes within the window, reducing syscalls. Adds a small latency budget equal to the coalesce window. Useful under high fan-out.ws_write_coalesce_max_frames(env:VOXRAY_WS_WRITE_COALESCE_MAX_FRAMES) — caps the number of frames coalesced per write window.
recording.worker_count and recording.queue_cap control the upload worker pool. Recordings stream from temp files to S3 — no full WAV is held in memory — so memory impact is bounded by the pipeline buffer, not recording duration.
Horizontal scaling
- Single instance
- Multiple instances (Redis)
The default in-memory session store works with no extra dependencies. Sessions live in the process; a restart clears all session state.Suitable for development, low-traffic deployments, and stateless runner configurations (e.g. WebSocket only without
/start).Health and readiness probes
Voxray exposes two purpose-built endpoints. Use both in your load balancer or orchestrator.| Endpoint | Probe type | Returns | Behavior |
|---|---|---|---|
GET /health | Liveness | 200 {"status":"ok"} | Always returns 200 when the process is running |
GET /ready | Readiness | 200 / 503 | Returns 503 if Redis is unreachable (when session_store=redis) |
server_api_key is set.
Graceful shutdown
Voxray handlesSIGTERM and drains in-flight requests before exiting. In Kubernetes, set terminationGracePeriodSeconds to at least as long as your longest expected voice session, or to a value that matches your SLA for call interruption.
preStop hooks, a short sleep before the process exits gives the load balancer time to deregister the pod before connections are dropped:
docker compose stop sends SIGTERM followed by SIGKILL after the stop grace period (default 10 s). Increase with stop_grace_period:
Prometheus metrics
GET /metrics returns Prometheus text format from the shared registry. Metric names are stable across releases and safe to use in dashboards and alerts.
voxray_up 1— process health gaugevoxray_http_requests_total— request count by method, route, and status classvoxray_http_request_duration_seconds— latency histogram by routevoxray_http_active_connections— in-flight connections by route
metrics_enabled: false in config. The /metrics endpoint will remain but return an empty registry.