Hubfly spaceDocs
Console

Realtime

Realtime

A dedicated WebSocket server for live updates, chat, notifications and presence. It speaks the Pusher Channels protocol, so pusher-js, Laravel Echo and Pusher server libraries work by changing the host and keys.

A realtime server is an instance in a Managed service project, next to any Managed Databases. Hubfly space creates the server, gives it a TLS hostname, keeps app secrets encrypted and operates it. You manage it in the Dashboard, with hubfly realtime, with the SDKs or through the Realtime API. Your apps connect with @hubfly/realtime or any Pusher client.

Availability

Realtime is offered where Hubfly space has enabled it for a region, and it is being rolled out gradually. If no region offers it yet, creating a server fails with MANAGED_SERVICES_UNAVAILABLE ("Managed services are not accepting new realtime servers right now"). Try again later; nothing is created or billed.

Choose a guide

Pusher compatibility

A Hubfly space realtime server speaks Pusher Channels protocol 7 on wss://<host>/app/<key> and the Pusher HTTP API on https://<host>/apps/<app_id>/…, with the same request signing. To move an app that uses Pusher:

  1. Create a server and an app, then copy its host, app id, key and secret.
  2. In your clients, set the WebSocket host to your server's host on port 443 with TLS. The cluster option is required by pusher-js but not used: clients must set the host.
  3. In your server library, set the host, port 443 and TLS, and replace the app id, key and secret.
JavaScript
import Pusher from "pusher-js";

const pusher = new Pusher("your-app-key", {
  wsHost: "chat-1a2b.rt.hubfly.app",
  wssPort: 443,
  forceTLS: true,
  enabledTransports: ["ws", "wss"],
  cluster: "mt1", // required by pusher-js; Hubfly space uses the host above
  channelAuthorization: { endpoint: "/api/realtime/auth", transport: "ajax" },
});

Public, private, presence and private-encrypted- channels, cache channels, client events, user sign-in, sendToUser, the channel and user REST endpoints and Pusher-format webhooks all work. Hubfly space tests this against pusher-js 8, Laravel Echo 2, the Node pusher library and pusher-http-go.

Differences to know about

WebSockets only: there are no HTTP or SockJS fallback transports, no compression (permessage-deflate), no binary frames and no watchlists. A failed private-channel authorization answers pusher:subscription_error on that channel, which pusher-js 8 and Laravel Echo handle. Session resume, direct messages to one connection, delivery receipts and full end-to-end encryption need the Hubfly space client.

How it fits together

ResourceWhat it is
Managed service projectA project type for services Hubfly space operates. Hubfly space chooses where it runs; there is no region picker.
Realtime serverOne dedicated WebSocket server with its own CPU, memory and a small storage volume for history and webhook queues. Its hostname is the server name plus a short suffix, such as chat-1a2b.rt.hubfly.app. Sockets and the server API share that host on port 443.
AppThe unit your code talks to, like a Pusher app: a numeric app id, keys and its own settings. One server holds up to 100 apps, for example production and staging. Setting changes apply live.
KeyA public key (browsers use it) and a secret that signs channel access and server calls. Up to 10 per app; rotating a key keeps the old one working for a grace period.
WebhooksUp to 10 HTTPS endpoints per app that receive signed event batches.
Connected projectA Cell project that receives an app's connection variables in the Hubfly space SDK or Laravel/Pusher format.

Channels and messages

Channel nameTypeWho may subscribe
orders (no prefix)PublicAnyone with the app key
private-…PrivateClients your auth endpoint approves
presence-…PresenceApproved clients, with a member list of who is online
private-encrypted-…EncryptedApproved clients that also receive the channel's decryption key

A cache- part after the type prefix (cache-, private-cache-, presence-cache-) makes a cache channel: new subscribers get the last event, kept for 30 minutes. Beyond Pusher's channel events, Hubfly space adds:

  • Direct messages to one connection, and user messages to every connection of a signed-in user, with delivery statuses and optional acknowledgements (receipts).
  • Channel history with positions, so Hubfly space clients that reconnect catch up on what they missed. Durable by default: 2 minutes or 100 messages per channel.
  • Sessions. A Hubfly space client that drops keeps its connection id, subscriptions and presence for up to 60 seconds by default, and gets buffered messages when it resumes.
  • An offline queue for user messages sent while the user has no connection (off by default).
  • End-to-end encryption with keys only you hold.

What Hubfly space runs for you

  • Provisioning and TLS. Hubfly space creates the server and its volume, gives it a hostname under rt.hubfly.app with a trusted certificate, and runs it in a location it chooses.
  • Keys. Secrets are generated by Hubfly space and stored encrypted. They are shown once when created or rotated, or through an audited reveal.
  • Limits per size. Connections, deliveries per second, API publishes per second, payload size and bandwidth are set by the server's size. App settings can lower them.
  • Operations. Start, stop, restart, resize, version updates, a live debug console, insights, logs, metrics and alerts for connections near the size limit, a server that is down and failing webhooks.

One server, one location

Each realtime server runs on a single node in one location. There are no replicas and no high availability: if the server stops, clients cannot connect until it is back. Plan for reconnects in your client code; every supported client reconnects on its own.

Restarts, updates and resizing

ActionWhat clients notice
RestartAn in-place handoff to a new server process, about 1–3 seconds. Clients are asked to reconnect and do so at once; no connection attempt is refused. Hubfly space SDK clients keep their connection id, subscriptions and presence and replay missed messages. pusher-js clients reconnect and resubscribe.
ResizeApplies live, without a restart. Open connections stay connected.
Version updateClients are drained and asked to reconnect; the server is unavailable for about 10–20 seconds while the new version starts. Sessions and history are saved first, so Hubfly space clients resume afterwards.
StopEvery client is disconnected and cannot reconnect until you start the server again. Apps, keys and stored history stay.

After any restart, channels, presence members and users that come back within 30 seconds produce no occupied, vacated, member or online/offline webhooks, so routine maintenance does not flood your webhook endpoints.

Network access

A realtime server is always reachable at its public hostname, and every connection uses TLS. The optional IP allowlist (up to 64 addresses or CIDR ranges) guards only the server API: the /apps/… endpoints your backend calls with the app secret. WebSocket clients are never IP-restricted. To limit which websites may open connections, set the app's allowed origins instead.

bash
hubfly realtime network allow chat 203.0.113.10/32 --label api-server
hubfly realtime network chat

Team access

PermissionAllows
realtime:readSee servers, apps, key hints, settings, metrics, insights, usage, channel names and counts, webhooks (URL query strings hidden) and deliveries, logs.
realtime:publishEnd-user data and live traffic: the connection list (IPs, origins, user ids), presence members, the debug console, history, and publishing or sending events.
realtime:adminCreate, lifecycle, resize and delete; apps, keys and secrets; webhooks; connected projects; network; disconnecting clients; purging history.

Organization owners, admins and operators have all three; viewer roles have realtime:read. Key reveals, rotations, publishes and disconnects are recorded in the server's activity log, without payloads or secrets.

From the terminal

This creates a server in a new managed project with a first app, connects a Cell project named web and publishes a test event:

bash
hubfly realtime create chat --size nano --project new
hubfly realtime bind chat --to web --client-prefix NEXT_PUBLIC_
hubfly realtime publish chat --channel orders --event order.updated --data '{"id":42}'

hubfly rt is a short alias. See the hubfly realtime reference for every command.

Something unclear or out of date? Emailsupport@hubfly.spaceBack to top