QA Steps sandbox · Protocol sandbox

Protocol sandbox

Bifrost: the bridge between worlds, on the same engine.

Your tasks

A code appears when a task is done – type it into the lesson.

Sign in to see your tasks

Tasks check what you did, so they need your account.

/ws/ravens Not connected

Your token goes with the connection as ?token=.Signed out: the server closes the connection with 4401. Sign in

Messages
  1. Connect, then send the subscribe frame. Events of your raven appear here as they happen.
Send a frame
Your ravens RVN-1 to RVN-3 take off the first time you subscribe to them.

Ravens – WebSocket

C6.11

Subscribe to one of your ravens (RVN-1 to RVN-3) and receive its flight as it happens.

DirectionFrameMeaning
you send{"type":"subscribe","raven_id":…}Follow one raven. The value is RVN-1, RVN-2 or RVN-3.
you send{"type":"unsubscribe",…}Stop following it.
you send{"type":"ping"}Application-level ping.
you get{"type":"subscribed",…}Your subscription is on. Events of that raven follow.
you get{"type":"raven.status","seq":…,"status":…}One status change: released, lost_in_frost, on_the_bridge, at_the_far_gate, delivered, recalled.
you get{"type":"pong"}The answer to your ping.
you get{"type":"error","code":…}Something is wrong with your frame. The connection stays open.

Every frame is JSON text. Events of one raven arrive in order with a growing seq. Packing and shipping are simulated: a few seconds after payment. A frame you cannot use gets an error frame, not a closed connection.

How to call it from your tools

In Postman

1Create the request: New → WebSocket, then enter the URL

2Before you connect, open Headers and add Authorization with the value Bearer and your token. Or add a token parameter in Params.

3Press Connect. Without a token the connection opens and closes at once with code 4401.

4In the message composer choose JSON, paste this and press Send. The value is RVN-1, RVN-2 or RVN-3.

5Watch the messages list. Send a wrong value to see an error frame; send a ping to get a pong.

With wscat

Then type the subscribe frame and press Enter. An event looks like this:

And a mistake like this (the connection stays open):

Close codes

Close codeWhen
4401No token or API key, or an invalid one.
4429More than 5 open connections for your account.
1009A frame larger than 4 KB.
1001The server is stopping.