How it works
The web channel makes an outbound WebSocket connection to a relay proxy. Your browser/iOS client connects to the same relay separately, and the relay forwards messages between them. The gateway authenticates to the relay with a short-lived HS256 JWT it signs locally.
relayUrl/serverId), the channel cannot connect and stays dormant β these values come from Flowly Cloud pairing.
Configuration
Set under channels.web in ~/.flowly/config.json:
{
"channels": {
"web": {
"enabled": true,
"relayUrl": "wss://relay.example.com/relay",
"serverId": "...",
"authToken": "...",
"jwtSecret": "..."
}
}
}| Key | Type | Default | Description |
|---|---|---|---|
enabled | bool | false | Start the web channel at gateway boot. |
relayUrl | string | "" | Relay WebSocket URL. Set by Flowly Cloud pairing; leave empty for self-host with no relay. |
serverId | string | "" | Flowly server ID. |
authToken | string | "" | Gateway auth token (gatewayAuthToken). |
jwtSecret | string | "" | Secret used to sign the relay-auth JWT. |
Connect method and auth
On connect, the channel builds an HS256 agent JWT (claims include type:"agent", serverId, gatewayAuthToken, iat, a 24-hour exp, plus issuer/audience) and dials {relayUrl}?token={jwt}.
JWT-signing-secret resolution order:
- Env
MOLTBOT_PROXY_JWT_SECRET(unless it is the placeholder default) jwtSecretfrom configauthTokenfrom config (used as the signing secret if nojwtSecret/env is set)
serverId falls back to the env var FLOWLY_SERVER_ID if not set in config. wss:// connections use a certifi TLS context.
Once connected, the relay forwards ready, browser-connected/disconnected, rpc, and ping frames. The RPC surface includes chat.send/chat.abort with per-run task tracking and cooperative abort. Exec-approval and compaction events are pushed to relay sessions, and the gateway uses the web channel's session for bot-created web crons.
Populating the config
These fields are normally filled in for you by Flowly Cloud:
flowly loginflowly login pairs your gateway with Flowly Cloud and populates relayUrl, serverId, authToken, and jwtSecret. After that, set channels.web.enabled to true and start the gateway.
Setup steps
- Run
flowly loginto pair with Flowly Cloud (populates the web config keys). - Set
channels.web.enabledtotrue. - Start the gateway:
flowly gateway. - Open your Flowly web/mobile client; it connects through the relay.
relayUrl/serverId empty, so the web channel will not connect.