EOXLABS builds real-time and voice systems on Cloudflare's network. Messages, presence and live state travel over WebSockets held by Durable Objects, which can hibernate between messages without dropping their clients. Audio and video travel over WebRTC through Cloudflare Realtime. Each live feature gets the transport that matches its latency and consistency needs.
Which transport fits which live feature?
The first decision in any real-time design is which kind of traffic each feature carries. State and media have different needs, and mixing them on one transport is a common source of trouble.
| Live feature | Transport | Where the authority lives |
|---|---|---|
| Chat, notifications, presence, collaborative editing | WebSocket, as defined in RFC 6455 | One Durable Object per room, document or inbox |
| Live dashboards fed by many sources | WebSocket fan-out from a Durable Object | The Durable Object that aggregates the sources |
| Calls between people, one-to-one or in groups | WebRTC through Realtime SFU, which routes WebRTC audio, video and DataChannels between endpoints | The application server that decides who publishes and who receives |
| Calls with a ready-made interface | RealtimeKit SDKs and UI components for web and mobile apps | The application, through RealtimeKit |
| A voice agent: speech in, speech out | WebRTC to the SFU, then a WebSocket to the agent | A Durable Object per conversation |
| Broadcast to a large audience that mostly watches | Stream Live, a separate Cloudflare product | The broadcaster |
The Cloudflare Realtime overview lists the parts referred to here, including Cloudflare TURN, which relays WebRTC traffic when a NAT or firewall blocks a direct connection, and a WebSocket adapter that moves PCM audio between Realtime SFU and a WebSocket service. WebRTC itself is the W3C Recommendation WebRTC: Real-Time Communication in Browsers.
Why does EOXLABS hold WebSockets in Durable Objects?
A Durable Object has a globally unique name, so every client in a room connects to the same object, and that object holds the one true copy of the room's state. There is no second server to keep in sync.
The cost problem with long-lived connections is idle time. A chat room may be silent for hours while its members stay connected. Cloudflare's WebSocket Hibernation API solves this: when the object receives no events for a short period it is evicted from memory, while its WebSocket clients remain connected to Cloudflare's network, and billable duration charges do not accrue during hibernation. The next message wakes the object. Incoming ping frames get automatic pong replies without waking it.
Hibernation changes how the code is written. In-memory state is lost on eviction, so per-connection state goes into a serialized attachment or into storage. Outbound connections, alarms and timers keep an object awake, so EOXLABS keeps them out of objects that are meant to sleep. A minimal room looks like this:
import { DurableObject } from "cloudflare:workers";
export class Room extends DurableObject {
async fetch(request: Request): Promise<Response> {
const [client, server] = Object.values(new WebSocketPair());
this.ctx.acceptWebSocket(server);
return new Response(null, { status: 101, webSocket: client });
}
async webSocketMessage(ws: WebSocket, message: string | ArrayBuffer) {
for (const peer of this.ctx.getWebSockets()) {
if (peer !== ws) peer.send(message);
}
}
}
The engineering note on building a real-time inbox with WebSocket hibernation works through a complete design.
How does a voice agent run on this architecture?
- The caller's app opens a WebRTC session to Realtime SFU. TURN carries it through restrictive networks.
- The WebSocket adapter moves the caller's audio, as PCM, to a WebSocket service that EOXLABS builds on a Durable Object, one per conversation.
- The object streams the audio to a speech recognition provider, passes the text and the conversation state to a language model, and streams synthesized speech back the same way.
- The object records each turn with timestamps: what was heard, what the model returned, and which tools it called. The same guardrails as any AI system with human review and evaluation apply.
- When the caller interrupts, the object stops playback and discards the rest of the reply, so the agent listens instead of talking over the caller.
Speech and model providers are chosen per engagement, against the latency each turn can afford and the rules on where audio may be sent.
When does a product need real-time engineering?
- Polling has become the largest source of load, and users still see stale data.
- Several people edit the same thing, and the last save silently wins.
- The product needs calling, or a voice interface, inside its own app rather than through a third-party meeting link.
- The current system pays for every idle connection, and the bill grows with users who are connected but quiet.
What does the client receive?
- A transport map: each live feature, the transport it uses, and the object or server that holds its state.
- The Durable Object classes with their state model, persistence rules and hibernation behavior written down.
- Reconnection and resynchronization logic for every client: what a client that was offline for a minute, or a day, receives when it returns.
- For voice: the turn pipeline, the latency budget for each stage, and the conversation log format.
- Load and soak tests that hold connections open for long periods, not only bursts.
When isn't real-time engineering the right fit?
- The data changes every few minutes. Plain HTTP with caching, or a refresh on focus, is simpler and cheaper than a live connection.
- The audience mostly watches. Broadcasting to many viewers is a streaming problem; Stream Live or a dedicated broadcast service fits it better than an SFU.
- The system needs guaranteed timing. Industrial control loops and safety systems need deterministic networks and local controllers. A connection over the public internet can't promise that.
What connects to real-time work?
Real-time features rest on the Durable Object placement decisions made in edge architecture, and they reach phones and desktops through native apps that share the same backend. The capabilities overview shows the other parts of an engagement.
The stack pages on Durable Objects and Cloudflare Workers describe the runtime. The note on Durable Object alarms covers scheduled work inside a room, such as expiring presence.
Live features carry the most weight in telecommunications, media and entertainment and hospitality and membership, where those pages describe what users expect.