Overview
The Fluxer Relay Directory is a service for discovering and managing voice relay servers. It provides a centralized registry of available relay servers with geographic information, capacity metrics, and health monitoring.Endpoints
Browse relay directory endpoints
Relay Registration
Register new relay servers
Health Monitoring
Automatic health checks and failover
Geographic Routing
Location-based relay selection
What is a Relay?
A relay server is a WebRTC voice server that routes voice traffic between clients. The Relay Directory helps clients discover the best relay server based on:- Geographic proximity - Lower latency for users
- Server capacity - Available connection slots
- Health status - Active and responding servers only
- Regional distribution - Global coverage
Architecture
Key Components
Relay Registry
Relay Registry
SQLite-based registry storing relay information:
- Relay ID and name
- URL and region
- Geographic coordinates (latitude/longitude)
- Capacity and current connections
- Health status and last seen timestamp
- Public key for encryption
Health Check Service
Health Check Service
Background service that periodically checks relay health:
- HTTP health check requests
- Marks relays as unhealthy after failed checks
- Removes relays after extended downtime
- Configurable check interval and failure threshold
Geographic Routing
Geographic Routing
Distance-based relay selection:
- Haversine formula for distance calculation
- Sorts relays by proximity to client
- Filters unhealthy relays
- Returns top N closest relays
Bootstrap Relays
Bootstrap Relays
Pre-configured relays loaded at startup:
- Ensures service availability
- Regional coverage
- High-capacity servers
Base URL
The relay directory is typically deployed as a standalone service:Authentication
The Relay Directory has two types of endpoints:Public Endpoints
Public endpoints (listing, status) require no authentication:Administrative Endpoints
Relay management endpoints (register, heartbeat, delete) are currently unauthenticated but should be protected by network policies in production:Configuration
The relay directory is configured via:Relay Information
Each relay in the directory contains:Health Monitoring
The health check service runs in the background and:- Periodic Checks - Queries each relay’s health endpoint every 30 seconds (configurable)
- Failure Tracking - Increments
failed_checkson timeout or error - Mark Unhealthy - Sets
healthy: falseafter 3 consecutive failures (configurable) - Removal - Deletes relay after 10 consecutive failures (configurable)
- Recovery - Resets
failed_checksand marks healthy on successful check
Health Check Request
200 OK
Geographic Routing
Clients can query relays with their location to get the closest servers:- Calculates distance from client to each healthy relay
- Sorts by distance (ascending)
- Returns top N relays (default: 10)
Distance Calculation
Uses the Haversine formula for great-circle distance:Bootstrap Relays
Bootstrap relays are pre-configured in the deployment config and loaded at startup:Database Schema
The SQLite database uses the following schema:Relay Lifecycle
Best Practices
Send Regular Heartbeats
Send Regular Heartbeats
Relay servers should send heartbeat requests every 15-30 seconds to keep their
last_seen_at timestamp current.Implement Health Endpoints
Implement Health Endpoints
Relay servers must implement
GET /_health endpoint that returns 200 OK when healthy.Use Geographic Distribution
Use Geographic Distribution
Deploy relays in multiple regions for global coverage and lower latency.
Monitor Capacity
Monitor Capacity
Update
current_connections regularly to help the directory balance load across relays.Set Appropriate Capacity
Set Appropriate Capacity
Configure relay
capacity based on server resources (CPU, memory, bandwidth).Monitoring
Health Check Endpoint
Metrics
The relay directory tracks:- Total registered relays
- Healthy vs unhealthy relays
- Health check success/failure rate
- Average response time
- Geographic distribution
Next Steps
Endpoints
Explore relay directory endpoints
API Reference
Return to API overview
Voice Integration
Learn about voice channel integration
Deploy a Relay
Deploy your own relay server