> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/welcome/global-accelerator/faq/when-should-i-consider-using-layer-7-websockets.md).

# When should I consider using Layer 7 WebSockets

Layer 7 WebSockets should be used when real-time, bi-directional, and persistent communication between the client and the server is required. This is because WebSockets allow for efficient and low-latency communication by maintaining a persistent connection between the client and the server, avoiding the overhead of setting up and tearing down a new connection for every request.

Some common use cases for WebSockets include:

1. Online gaming: WebSockets can be used to create real-time multiplayer games that require low-latency communication between players and the server.
2. Chat applications: WebSockets can be used to create chat applications that require real-time messaging and notifications.
3. Collaborative editing: WebSockets can be used to enable real-time collaboration between multiple users, such as in document editing applications.
4. Real-time monitoring and notifications: WebSockets can be used to provide real-time updates and notifications for events such as stock prices, weather updates, or social media feeds.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.console.zenlayer.com/welcome/global-accelerator/faq/when-should-i-consider-using-layer-7-websockets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
