hubfly realtime
hubfly realtime creates and operates Realtime servers: dedicated WebSocket servers that speak the Pusher Channels protocol (version 7) with Hubfly space extensions and built-in end-to-end encryption. It covers servers, apps and keys, binding an app's credentials to a Cell project, publishing events, live inspection, webhooks and channel history. hubfly rt is an alias.
Basics
<server>is a Realtime server id or name. When two managed projects use the same name, add--project <id|name>.- A server holds one or more apps, each with its own keys and settings.
<app>is an app id or name; you can leave out--appwhen the server has one app. - Hubfly space chooses where Realtime servers run, so there is no
--regionflag. Sizes arenano,small,medium,largeandxlarge, or a custom--cpuand--memory(at least 512 MiB). - Commands that print data accept
--json. App secrets are printed only bykeys create,keys revealand commands run with--reveal. - Event data is sent as text. Run
hubfly realtime helpfor the full usage text.
terminal
Servers
hubfly realtime list [--project <id|name>] [--json]
hubfly realtime info <server> [--json]
hubfly realtime create [<name>] [--size <preset>|--cpu <n> --memory <mib>] [--storage <gib>]
[--project <id|name|new>] [--app <name>] [--yes] [--no-wait] [--json]
hubfly realtime delete <server> [--yes] [--wait]| Command | What it does |
|---|---|
rt list | Realtime servers in your managed projects with status, size, monthly price, project and id. |
rt info | Status, size, price and hostname (a *.rt.hubfly.app name) of one server. |
rt create | Quotes the monthly price, asks you to confirm, creates the server and waits until it is ready. --project new creates a managed project for it. --app names the first app (default production). Storage defaults to 1 GiB and holds channel history and webhook queues. |
rt delete | Deletes the server after you type its name (or pass --yes). Deletion protection must be off. It removes its app bindings and revokes its keys. --wait follows the deletion until it finishes. |
terminal
Lifecycle And Network
hubfly realtime start|stop|restart <server> [--no-wait] [--json]
hubfly realtime resize <server> [--size <preset>|--cpu <n> --memory <mib>] [--storage <gib>] [--yes] [--no-wait] [--json]
hubfly realtime upgrade <server> [--yes] [--no-wait]
hubfly realtime rename <server> <new-name>
hubfly realtime protect <server> on|off
hubfly realtime network <server> [--json]
hubfly realtime network allow <server> (<cidr>|--my-ip) [--label <text>]
hubfly realtime network remove <server> <cidr>
hubfly realtime logs <server> [--tail <bytes>] [--follow]
hubfly realtime metrics <server> [--window <duration>] [--json]
hubfly realtime operations <server> [--limit <n>] [--json]| Command | What it does |
|---|---|
rt restart | Hands connections over in place to a new server process in a few seconds. Clients reconnect at once without refused connections, and @hubfly/realtime clients keep their connection id and receive the messages they missed. |
rt stop, start | Stopping drains the server: clients are told to reconnect and are disconnected, and history and queued webhooks are saved. A stopped server pays for storage only. |
rt resize | Quotes the old and new monthly price and asks you to confirm. Resizing applies live and does not restart the server. Storage can only grow. |
rt upgrade | Applies an available server update after you confirm. Clients are drained and the server is unavailable for about 10–20 seconds; clients reconnect on their own. |
rt rename, protect | Change the display name (the hostname stays) or turn deletion protection on or off. |
rt network | Shows and edits the IP allowlist (up to 64 entries). The allowlist guards the server's HTTP API, which your backend uses to publish; WebSocket clients are never IP-restricted. |
rt logs, metrics, operations | Server logs (--follow to keep printing), resource metrics over a window such as 1h, and recent operations with their status. |
Apps And Keys
hubfly realtime apps [list] <server> [--json]
hubfly realtime apps create <server> <name> [settings] [--reveal] [--json]
hubfly realtime apps update <server> <app> [--name <name>] [--enable|--disable] [settings] [--json]
hubfly realtime apps delete <server> <app> [--yes]
hubfly realtime keys list <server> [--app <app>] [--json]
hubfly realtime keys create <server> [--app <app>] [--json]
(prints the new secret once; with --json it is in "secret")
hubfly realtime keys rotate <server> [<key>] [--app <app>] [--grace <duration>] [--reveal] [--yes] [--json]
hubfly realtime keys revoke <server> <key> [--app <app>] [--yes] [--json]
hubfly realtime keys reveal <server> [<key>] [--app <app>] [--json]
App settings (apps create/update):
--origins <a,b> --client-events[=false] --subscription-count[=false] --require-auth[=false]
--encryption off|optional|required --history off|memory|durable --history-ttl <duration>
--history-max <n> --offline-queue[=false] --max-connections <n> --max-message-bytes <n>
--payload-preview[=false]An app is what Pusher clients call an app: an app id, a key that clients use to connect and a secret that your backend uses to sign requests. A server can hold up to 100 apps and an app up to 10 keys.
| Setting | Meaning |
|---|---|
--origins | Browser origins allowed to connect, such as https://app.example.com (up to 50). Empty allows any origin. |
--client-events | Allow clients to send client-* events on private and presence channels. |
--subscription-count | Send pusher:subscription_count events to subscribers. |
--require-auth | Require every client to sign in as a user (pusher:signin) within 30 seconds of connecting; otherwise the connection is closed. |
--encryption | End-to-end encryption: off, optional or required. |
--history, --history-ttl, --history-max | Keep recent channel messages in memory or on disk (durable) so clients can catch up: for up to 24 hours and 1,000 messages per channel. |
--offline-queue | Queue direct messages for a user who is offline and deliver them when they reconnect. |
--max-connections, --max-message-bytes | Per-app caps on concurrent connections and message size. |
--payload-preview | Let the live inspector (rt tail --preview) show the start of message payloads. Encrypted payloads are never readable. |
| Command | What it does |
|---|---|
keys create | Adds a key to the app and prints its secret once, with a warning on standard error (in "secret" with --json). |
keys rotate | Creates a new key and keeps the old one working for a grace period: 24 hours by default, or --grace up to 30 days. --grace 0 revokes the old key at once and asks you to confirm. App bindings that used the old key receive the new one. |
keys revoke | Revokes a key after you confirm; clients and servers that use it are refused. |
keys reveal | Shows a key's secret again. Reveals are recorded in the activity log. |
terminal
Bind And Environment
hubfly realtime bind <server> --to <project> [--app <app>] [--preset hubfly|laravel]
[--client-prefix none|NEXT_PUBLIC_|VITE_|PUBLIC_] [--key <key>] [--json]
hubfly realtime bind list <server> [--json]
hubfly realtime bind remove <server> <bindingId> [--keep-variables] [--yes]
hubfly realtime env <server> [--app <app>] [--preset hubfly|laravel] [--client-prefix <prefix>]
[--key <key>] [--format dotenv|json] [--reveal]rt bind writes an app's credentials into a Cell project's environment, with the secret stored as a secret variable; redeploy or restart the project's containers to load them. rt env prints the same variables for a .env file, leaving out the secret unless you pass --reveal.
| Preset | Variables |
|---|---|
hubfly (default) | HUBFLY_REALTIME_URL, HUBFLY_REALTIME_APP_ID, HUBFLY_REALTIME_KEY, HUBFLY_REALTIME_SECRET. With --client-prefix, also browser copies of the URL and key, such as NEXT_PUBLIC_HUBFLY_REALTIME_URL and NEXT_PUBLIC_HUBFLY_REALTIME_KEY. The secret never gets a client copy. |
laravel | BROADCAST_CONNECTION=pusher, PUSHER_APP_ID, PUSHER_APP_KEY, PUSHER_APP_SECRET, PUSHER_HOST, PUSHER_PORT=443, PUSHER_SCHEME=https, PUSHER_APP_CLUSTER=mt1 and the matching VITE_PUSHER_* variables for Laravel Echo. |
HUBFLY_REALTIME_E2E_KEYS is never written by Hubfly space: you set it yourself (see end-to-end keys).
terminal
Publish And Send
hubfly realtime publish <server> --channel <name>... --event <name> [--data <text>|--data-file <path|->]
[--app <app>] [--exclude <socketId>] [--message-id <id>] [--json]
hubfly realtime send <server> (--connection <id>...|--user <id>) --event <name>
[--data <text>|--data-file <path|->] [--app <app>] [--strip-key] [--json]rt publishtriggers an event on one or more channels through the server API, as your backend would. Data comes from--data,--data-file(-for standard input) or piped input.--excludeskips one connection;--message-idsets an id that makes retries safe to repeat. The short formhubfly rt publish <server> <channel> <event> [<data>]also works.rt sendsends a direct message to specific connections or to every connection of a user.- End-to-end connection ids (
<socket_id>~<key>) carry a client key that must never reach Hubfly space. The CLI removes the key before any request and refuses to send plaintext to such a connection; encrypt the message on your own server with the Hubfly space server SDK, or pass--strip-keyto send it unencrypted.
terminal
Inspect And Debug
hubfly realtime tail <server> [--app <app>...] [--family conn,sub,member,msg,api,err,webhook]
[--channel-prefix <prefix>] [--preview] [--json]
hubfly realtime insights <server> [--app <app>] [--window <duration>] [--json]
hubfly realtime channels <server> [--app <app>] [--prefix <prefix>] [--limit <n>] [--json]
hubfly realtime channels inspect <server> <channel> [--app <app>] [--members <n>] [--json]
hubfly realtime history <server> --channel <name> [--app <app>] [--limit <n>] [--json]
hubfly realtime history purge <server> [--channel <name>] [--app <app>] [--yes]
hubfly realtime connections <server> [--app <app>] [--user <id>] [--channel <name>] [--limit <n>] [--json]
hubfly realtime disconnect <server> (--connection <socketId>...|--user <id>) [--app <app>] [--mode terminate|disconnect] [--yes]
hubfly realtime usage <server> [--app <app>] [--since <duration|YYYY-MM-DD>] [--json]| Command | What it does |
|---|---|
rt tail | Opens the live inspector and prints one line per event (--json for JSON lines): connections, subscriptions, presence members, messages, server API calls, errors and webhooks. Filter by family and channel prefix; --preview shows the start of payloads when the app allows it. Sampling and dropped events are noted on standard error. Press Ctrl-C to stop. |
rt insights | Peak connections, top channels and events, failure reasons, client libraries and webhook success rate over a window such as 6h. |
rt channels | Occupied channels with their subscriber counts; inspect shows one channel and its presence members. |
rt history | Stored messages of a channel, for apps with history on. purge deletes the history of one channel, or of every channel in the app, after you confirm. |
rt connections | Open connections, filtered by app, user or channel. |
rt disconnect | Closes connections or all connections of a user after you confirm. By default the client is told not to reconnect; for single connections, --mode disconnect lets the client reconnect. |
rt usage | Daily peak connections, connection minutes, messages and bytes in and out, and webhook deliveries, by default for the last 30 days. |
terminal
Webhooks
hubfly realtime webhooks [list] <server> [--app <app>] [--json]
hubfly realtime webhooks create <server> --url <https-url> --events <a,b> [--key <key>] [--disabled] [--app <app>] [--json]
hubfly realtime webhooks update <server> <webhook> [--url <url>] [--events <a,b>] [--key <key>] [--enable|--disable] [--app <app>] [--json]
hubfly realtime webhooks delete <server> <webhook> [--app <app>] [--yes]
hubfly realtime webhooks test <server> <webhook> [--app <app>] [--json]
hubfly realtime webhooks deliveries <server> [--webhook <webhook>] [--status <status>] [--limit <n>] [--app <app>] [--json]
hubfly realtime webhooks redeliver <server> <deliveryId> [--app <app>] [--json]- Webhook URLs must use
https://. An app can have up to 10 webhooks. - Events:
channel_occupied,channel_vacated,member_added,member_removed,client_event,cache_miss,subscription_count, and the Hubfly space eventshubfly.connection_opened,hubfly.connection_closed,hubfly.user_online,hubfly.user_offlineandhubfly.message_delivered. - Requests are signed with an app key: the app's newest key unless you choose one with
--key. They carry the Pusher headersX-Pusher-KeyandX-Pusher-Signatureand a Hubfly spaceX-Hubfly space-Signaturewith a timestamp. testsends a test request and prints the response status; it is not recorded as a delivery.deliverieslists recent deliveries (statusespending,delivered,failed,dead) andredeliverqueues one again.
terminal
End-To-End Keys
hubfly realtime keygen [--kid <kid>]rt keygen generates an end-to-end master key on your machine (32 random bytes, base64; kid:base64 with --kid) and sends it nowhere. Put it first in HUBFLY_REALTIME_E2E_KEYS on your own servers: a comma-separated list of kid:base64 entries in which the first entry encrypts and the others still decrypt, so you can rotate without breaking older messages. Hubfly space never stores or sees these keys.
terminal
Scripting And Secrets
- JSON output. With
--json, standard output carries only JSON; prompts and progress go to standard error. - Confirmations. Creating, resizing, deleting, revoking, purging and disconnecting ask first. Without a terminal they stop with
confirmation required; re-run with --yes; pass--yesonce you have reviewed the change. - Secrets. App secrets appear only in
keys create,keys reveal(audited) and with--revealonapps create,keys rotateandenv.--debugnever prints secrets or tokens. - Waiting. Long operations show progress and wait;
--no-waitreturns as soon as Hubfly space has accepted the request. Follow it later withhubfly rt operations. - Exit codes. Non-zero on failure, with distinct codes for usage errors, authentication, conflicts and timeouts. See exit codes.
Pusher clients need only the host and key
rt env. See the Realtime protocol reference for what is compatible.