WebSocket
Courier opens WebSocket connections through its own network stack, so you get the same timing, TLS and proxy behavior as HTTP requests.
Write a WebSocket request
Section titled “Write a WebSocket request”### Prices# @snippet ping {"type":"ping"}WEBSOCKET wss://example.com/streamAuthorization: Bearer {{token}}Sec-WebSocket-Protocol: prices.v1
{"type": "subscribe", "symbols": ["BTC-USD"]}=== wait-for-server{"type": "ping"}
> {% client.test("price is positive", () => client.assert(response.body.price > 0));%}- The request line is
WEBSOCKET ws://…orwss://…. Headers follow. - The body holds messages to send right after connecting, listed in the Messages tab.
===separates messages. === wait-for-serverholds the next message until the server sends something.
Connect
Section titled “Connect”Click Connect or press ⌘↵. Courier opens the socket and sends the initial messages in order. The Handshake tab shows the DNS, TCP, TLS timing breakdown.
Each tab has its own connection. A dot marks tabs that are connected.
Send messages
Section titled “Send messages”The composer sends text, JSON or binary (written as base64). {{variables}} work in messages, and ⌘↵ sends.
- Snippets saves a message into the file as
# @snippet name textso you can send it again later. - Close with code… closes the connection with a custom close code and reason.
Read the log
Section titled “Read the log”The log shows every message with its direction, time and size, plus pings, reconnects and close codes.
- Filter the log, pause autoscroll, copy it, or export it as
.jsonl. - Click a message to see it in full: foldable JSON, or a hex dump for binary.
- Edit & resend puts a message back into the composer.
Test messages
Section titled “Test messages”The > {% %} response handler runs for every text message received, with response.body set to the message. See Scripts.
Settings
Section titled “Settings”Settings → Requests has a keep-alive ping interval and auto-reconnect. See Settings.
Not supported
Section titled “Not supported”Socket.IO and STOMP framing, and GraphQL subscriptions, aren’t supported.