Update http.md

This commit is contained in:
Jarred Sumner
2025-01-28 00:56:56 -08:00
parent 1da2f4c0ec
commit 8c75c777c2

View File

@@ -677,6 +677,8 @@ const server = Bun.serve({
});
```
## WebSocket Configuration
### server.publish(topic, data, compress) - WebSocket Message Publishing
The server can publish messages to all WebSocket clients subscribed to a topic:
@@ -702,8 +704,6 @@ The `publish()` method returns:
- `0` if the message was dropped
- `-1` if backpressure was applied
## WebSocket Configuration
### WebSocket Handler Options
When configuring WebSockets, several advanced options are available through the `websocket` handler: