WebSocket Requests
Vegha supports WebSocket connections for testing real-time, bidirectional APIs. A WebSocket request stays open so you can exchange messages over a single long-lived connection.
Opening a connection
Section titled “Opening a connection”Create a WebSocket request and enter the endpoint URL — typically a ws:// or wss:// address. Connect to open the connection. While the connection is open, the request tab shows its status and the live message log.
You can use {{variable}} interpolation in the URL, so endpoints can be parameterized per environment. See Variables.
Sending messages
Section titled “Sending messages”With the connection open, type a message and send it. You can send as many messages as you need over the same connection. Each message you send is recorded in the message log.
The live message log
Section titled “The live message log”The message log shows every message exchanged on the connection in order, distinguishing messages you sent from messages received from the server. Because the log is live, it updates as the server pushes new messages, which makes it suitable for observing event streams and server-initiated traffic.
| Direction | Meaning |
|---|---|
| Sent | A message you sent to the server |
| Received | A message pushed from the server |
Closing the connection
Section titled “Closing the connection”When you are finished, close the connection from the request tab. This ends the WebSocket session. You can reconnect later to start a new session.