How stasync/relay-dotnet works
Relay is a .NET UDP relay node, controlled by a backend over an authenticated HTTP API. The backend opens rooms; clients connect to a room using a token, join, and exchange packets that the room forwards. Room lifecycle events can trigger backend webhooks. The graph preserves the control plane, UDP forwarding, and rate-limiting capability documented or visible in the supplied material. Some runtime wiring is unsampled, so only documented or evidenced relationships are connected.
Main entry points: Room.cs Room lifecycle and forwarding · Entry.cs Node startup · HttpServer.cs HTTP listener · HttpRequestHandler.cs API request handling
Components 15
Node runtime
- Node startup
runtime/Entry.cs - Startup configuration
runtime/StartupArguments.cs
HTTP control plane
- HTTP listener
runtime/HttpServer.cs - Route matching
runtime/RouteTemplate.cs - API request handling
runtime/HttpRequestHandler.cs - HTTP status errors
runtime/HttpStatusException.cs
Room and UDP traffic
- Room settings
runtime/RoomSettings.cs - Room lifecycle and forwarding
runtime/Room.cs - Client message types
runtime/ClientMessageType.cs - Room message types
runtime/RoomMessageType.cs - Ingress rate limiter
runtime/IncomingDataAmountTracker.cs
Webhook integration
- Webhook delivery and retry
runtime/HttpWebhookSender.cs
Other components
- Backend service
- UDP clients
- Backend webhook receiver
Connections 18
- Backend service → HTTP listener: calls API
README.md - HTTP listener → API request handling: dispatches requests
runtime/Entry.cs - HTTP listener → Route matching: matches routes
runtime/HttpServer.cs - HTTP listener → HTTP status errors: handles status errors
runtime/HttpServer.cs - API request handling → Room settings: parses settings
runtime/HttpRequestHandler.cs - API request handling → Room lifecycle and forwarding: reads and closes
runtime/HttpRequestHandler.cs - API request handling → Node startup: opens room via callback
runtime/Entry.cs - Node startup → Startup configuration: loads configuration
runtime/Entry.cs - Node startup → HTTP listener: starts listener
runtime/Entry.cs - Node startup → API request handling: binds handler
runtime/Entry.cs - Node startup → Room lifecycle and forwarding: creates and starts
runtime/Entry.cs - Room settings → Room lifecycle and forwarding: configures
runtime/Room.cs - UDP clients → Room lifecycle and forwarding: joins and sends UDP
README.md - Room lifecycle and forwarding → Client message types: decodes message types
runtime/Room.cs - Room lifecycle and forwarding → Room message types: emits room messages
runtime/Room.cs - Room lifecycle and forwarding → Ingress rate limiter: registers rate limiter
runtime/Room.cs - Node startup → Webhook delivery and retry: sends lifecycle events
runtime/Entry.cs - Webhook delivery and retry → Backend webhook receiver: posts webhooks
runtime/HttpWebhookSender.cs