Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions send-requests/websocket/create-request.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@

![WebSocket Settings](/images/screenshots/send-request/ws/ws-settings.webp)

### Step 5: Configure Subprotocols (Optional)

Check warning on line 61 in send-requests/websocket/create-request.mdx

View check run for this annotation

Mintlify / Mintlify Validation (bruno-a6972042) - vale-spellcheck

send-requests/websocket/create-request.mdx#L61

Did you really mean 'Subprotocols'?

Bruno supports WebSocket subprotocols, allowing you to specify the application-level protocol to use over the WebSocket connection.

Check warning on line 63 in send-requests/websocket/create-request.mdx

View check run for this annotation

Mintlify / Mintlify Validation (bruno-a6972042) - vale-spellcheck

send-requests/websocket/create-request.mdx#L63

Did you really mean 'subprotocols'?

**Setting a Subprotocol**

Check warning on line 65 in send-requests/websocket/create-request.mdx

View check run for this annotation

Mintlify / Mintlify Validation (bruno-a6972042) - vale-spellcheck

send-requests/websocket/create-request.mdx#L65

Did you really mean 'Subprotocol'?

WebSocket subprotocols enable your client to specify which protocol variant it wants to use. To set a subprotocol in Bruno:

Check warning on line 67 in send-requests/websocket/create-request.mdx

View check run for this annotation

Mintlify / Mintlify Validation (bruno-a6972042) - vale-spellcheck

send-requests/websocket/create-request.mdx#L67

Did you really mean 'subprotocols'?

Check warning on line 67 in send-requests/websocket/create-request.mdx

View check run for this annotation

Mintlify / Mintlify Validation (bruno-a6972042) - vale-spellcheck

send-requests/websocket/create-request.mdx#L67

Did you really mean 'subprotocol'?
- Add the `Sec-WebSocket-Protocol` header in the Headers tab
- Specify one or multiple subprotocols

Check warning on line 69 in send-requests/websocket/create-request.mdx

View check run for this annotation

Mintlify / Mintlify Validation (bruno-a6972042) - vale-spellcheck

send-requests/websocket/create-request.mdx#L69

Did you really mean 'subprotocols'?

**Example:**
```
Expand All @@ -87,7 +87,7 @@

**Server Rejections**

If the server doesn't support the requested subprotocol or version:

Check warning on line 90 in send-requests/websocket/create-request.mdx

View check run for this annotation

Mintlify / Mintlify Validation (bruno-a6972042) - vale-spellcheck

send-requests/websocket/create-request.mdx#L90

Did you really mean 'subprotocol'?
- The connection will be rejected
- You'll see a **400 Bad Request** response
- Check the response details to understand why the server rejected the connection
Expand All @@ -100,3 +100,9 @@

Simply add these headers in the Headers tab like any other custom header.

## Adding Multiple Messages

A WebSocket request in Bruno can hold more than one message. After creating the request, open the **Body** tab and use the `+` icon in the toolbar to add additional messages. Each message has its own name, type (Text, JSON, or XML), and payload, and any one of them can be sent at a time.

For details on the message editor, type selection, and send behavior, see the [Request Interface](./ws-interface) page.

2 changes: 2 additions & 0 deletions send-requests/websocket/message-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ sidebarTitle: "Message Types"

Bruno supports various message types for WebSocket communication, allowing you to send and receive different data formats based on your application's requirements.

When a request contains multiple messages, the type is set per message — you can mix Text, JSON, and XML messages within the same WebSocket request. New messages default to **JSON**.

## Supported Message Types

Bruno supports the following WebSocket message types:
Expand Down
2 changes: 2 additions & 0 deletions send-requests/websocket/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ title: "Overview"

Bruno now supports WebSocket connections, enabling you to test real-time communication protocols and bidirectional data exchange. This feature allows you to establish WebSocket connections, send messages, and receive responses in real-time.

A single WebSocket request can hold multiple named messages — each with its own type and payload — so you can keep all the message variants for an endpoint together and send them on demand.

## What are WebSockets?

WebSockets provide a persistent, full-duplex communication channel between a client and server. Unlike traditional HTTP requests that follow a request-response pattern, WebSockets maintain an open connection that allows both the client and server to send messages at any time.
Expand Down
41 changes: 36 additions & 5 deletions send-requests/websocket/ws-interface.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,23 @@
- **Disconnected**: Connection lost or manually closed

### Message Composition
- **Message Type**: Choose between Text, JSON, XML
- **Message Editor**: Compose your message with syntax highlighting
- **Send Button**: Send the composed message

Bruno organizes WebSocket messages as a list of collapsible accordion panels, so you can save multiple reusable messages alongside a single request and send any one of them on demand.

Each message panel includes:

- **Message name**: Double-click the label to rename a message inline
- **Message type**: Switch between Text, JSON, and XML per message
- **Message editor**: Compose the payload with syntax highlighting
- **Send button** (per message): Send that specific message; auto-connects if the WebSocket is not yet connected
- **Delete button**: Remove the message (available when the request has more than one message)

The body tab also exposes two toolbar actions in the top-right:

- **Add Message** (`+`): Append a new message; new messages default to JSON and auto-expand for editing
- **Prettify All** (wand icon): Format every JSON and XML message in the request

The currently selected message (highlighted; others appear dimmed) is the one that will be sent when you click the global **Send** button at the top of the request.

### Message History
- **Sent Messages**: All messages you've sent (marked with →)
Expand All @@ -37,12 +51,29 @@
### Sending Messages

1. **Compose your message** in the message editor
2. **Select message type** (Text, JSON, XML)
3. **Click "Send"** to transmit the message
2. **Select the message type** (Text, JSON, XML) for that message
3. **Send the message** in one of two ways:
- Click the per-message **Send** button on a specific message panel to send that message
- Click the global **Send** button at the top of the request to send the currently selected message
4. **View sent message** in the message history

If the WebSocket connection is not yet open, sending a message will auto-connect first.

![Send WebSocket Request](/images/screenshots/send-request/ws/send-ws-req.webp)

### Working With Multiple Messages

You can store multiple messages in a single WebSocket request, which is useful for testing different payload variants without creating separate requests.

1. **Add a message**: Click the `+` icon in the body tab toolbar (or the **Add message** link if the request has none). New messages default to JSON.
2. **Rename a message**: Double-click the message name in the accordion header and press Enter to save.
3. **Switch types per message**: Use the type selector in each message panel to change between Text, JSON, and XML independently.
4. **Select the active message**: Click any message panel to select it; the selected message is what the global **Send** button transmits.
5. **Prettify all**: Click the wand icon in the body tab toolbar to format every JSON and XML message at once.
6. **Delete a message**: Hover the message header and click the trash icon. The delete control is hidden when only one message exists.

Multi-message support is preserved across both `.bru` and `.yml` collection formats, so saved requests round-trip without losing message names, types, or selection state.

### Receiving Messages

1. **Monitor the message history** for incoming messages
Expand All @@ -55,4 +86,4 @@
2. **Connection status** will update to "Disconnected"
3. **Message history** is preserved for review

![Disconect WS](/images/screenshots/send-request/ws/disconnect-ws.webp)

Check warning on line 89 in send-requests/websocket/ws-interface.mdx

View check run for this annotation

Mintlify / Mintlify Validation (bruno-a6972042) - vale-spellcheck

send-requests/websocket/ws-interface.mdx#L89

Did you really mean 'Disconect'?
Loading