Skip to navigation

Realtime connection

The control frames of a realtime connection: the handshake, subscriptions, acknowledgements and liveness checks.

All realtime traffic shares one WebSocket, wss://api.evvahub.com/realtime, or WebTransport at https://realtime.evvahub.com (HTTP/3) with the same frames. Realtime walks through a whole session.

Frames on this page

  • Frames that belong to the connection rather than to a channel. They carry channel: null.
  • The subscribe and unsubscribe commands and their answers.
  • ack, which names its channel in the envelope.

Handshake

WSS
wss://api.evvahub.com/realtime

Send

sendConnectionErrorobjectRequired

Receive

receiveHelloobjectRequired

Send your evpa_ access token as credential with principal: "application", never with agencyId.

Errors

  • No valid hello within the handshake window, 5 seconds by default: the connection closes with HANDSHAKE_TIMEOUT.
  • An unsupported protocol version: an error UNSUPPORTED_PROTOCOL_VERSION with supportedVersions, then a close with PROTOCOL_VERSION_UNSUPPORTED.
  • A credential that does not authenticate: an error UNAUTHENTICATED (or SESSION_REVOKED), then a close with UNAUTHENTICATED.
OR
receiveSubscribeobjectRequired

You can ask for at most 32 channels per frame and 128 per connection (the defaults).

When the connection resumed, a granted reliable channel replays what your client missed. A gap that cannot be replayed is reported with an error RESUME_REJECTED that names the channel in its envelope.

OR
receiveUnsubscribeobjectRequired
OR
receivePingobjectRequired
OR
receiveAckobjectRequired