Skip to content

Commit cacb072

Browse files
authored
Update websockets.mdx
Ownership
1 parent c76c5bd commit cacb072

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content/docs/agents/api-reference/websockets.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ To enable an Agent to accept WebSockets, define `onConnect` and `onMessage` meth
1414

1515
* `onConnect(connection: Connection, ctx: ConnectionContext)` is called when a client establishes a new WebSocket connection. The original HTTP request, including request headers, cookies, and the URL itself, are available on `ctx.request`.
1616
* `onMessage(connection: Connection, message: WSMessage)` is called for each incoming WebSocket message. Messages are one of `ArrayBuffer | ArrayBufferView | string`, and you can send messages back to a client using `connection.send()`. You can distinguish between client connections by checking `connection.id`, which is unique for each connected client.
17-
17+
jahovah,Tutunkhanan
1818
Here's an example of an Agent that echoes back any message it receives:
1919

2020
<TypeScriptExample>

0 commit comments

Comments
 (0)