# Websockets

A WebSocket is a communication protocol that provides two way communication channels over a single TCP connection between a client and server. This means that once a WebSocket connection is established, both the client and server can send and receive data simultaneously without the need for repeated HTTP requests.

## **Why Use WebSockets?**

WebSockets are especially valuable in situations where real-time updates are essential. Below are some typical use cases:

* **Blockchain and apps**: WebSockets allow for real-time tracking of blockchain activities, such as new transactions, changes in contract states, or validator updates.
* **Live Notifications**: Applications can instantly send notifications to users, like alerts for new messages or important updates.
* **Collaborative Tools**: Real-time collaboration platforms, such as shared document editors, depend on WebSockets to synchronize changes among users.
* **Gaming and Streaming**: WebSockets are utilized to provide real-time game state updates or to stream live video and audio content.

In the context of XION, WebSockets enable developers to subscribe to blockchain events and receive instant updates, facilitating the development of dynamic and interactive apps.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.burnt.com/xion/developers/computation/integrations/websockets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
