// websocket

WebSocket

Resonance keeps a real WebSocket connection open in the background so you can send and receive messages interactively, with a full transcript of the exchange.

What It Does

  • Connects to ws:// and wss:// endpoints
  • Keeps one reusable connection open per request tab
  • Sends custom handshake headers (auth tokens, subprotocols, and more)
  • Resolves {{variables}} in the URL, headers, and message
  • Composes messages as JSON or plain text, with one-click formatting for JSON
  • Shows a transcript of everything sent and received, newest first, with timestamps
  • Saves WebSocket requests alongside HTTP and gRPC requests

Connecting

  1. Create a request with a ws:// or wss:// URL — Resonance switches to WebSocket mode
  2. Add any handshake headers the server requires
  3. Click Connect, the button left of Send — Resonance opens the connection without sending anything
  4. While the handshake is in progress the button reads Cancel; once the socket is open it reads Disconnect
  5. The connection stays open until you disconnect or close the tab

The Request Timeout setting limits the handshake only. An open socket is never timed out; it stays connected until you disconnect or the server closes it. Try wss://echo.websocket.org to see the transcript in action.

Sending & Receiving

  • Choose JSON or Text as the message mode in the body editor. In JSON mode, Format pretty-prints the message; it is never reformatted automatically, and switching modes keeps the message exactly as typed
  • Click Send — the message appears in the transcript, with variables already filled in. Send never connects on its own; on a disconnected tab it reports “WebSocket is not connected”
  • New messages, sent or received, appear at the top of the transcript
  • The connection is reusable, so send as many messages as you need
  • The trash button in the response header clears the transcript while leaving the connection open; the next message starts a fresh log

Closing the Connection

While the socket is open, the button left of Send reads Disconnect. Click it, press Esc, or close the tab. Connection state is tracked per tab, so other tabs are unaffected, and a connection stays attached to the tab that opened it when you switch tabs.

Troubleshooting

Connection refused

  • Check the scheme — ws:// for plaintext, wss:// for TLS
  • Confirm the server is reachable and listening on that port

Handshake rejected (401 / 403)

  • Add the required handshake headers or auth token
  • For wss:// with a private CA, configure custom CA trust in the certificate settings

Next Steps

  • Server-Sent Events — one-way server streaming over plain HTTP
  • MQTT — publish/subscribe messaging over a persistent connection