# WebSocket

WebSocket RPC endpoints for real-time communication

## WebSocket RPC endpoint

> Upgrade HTTP connection to WebSocket for real-time RPC communication

```json
{"openapi":"3.0.3","info":{"title":"Amadeus Blockchain API","version":"1.5.0"},"tags":[{"name":"WebSocket","description":"WebSocket RPC endpoints for real-time communication"}],"servers":[{"url":"https://nodes.amadeus.bot","description":"Mainnet"},{"url":"https://testnet-rpc.ama.one","description":"Testnet"}],"paths":{"/ws/rpc":{"get":{"tags":["WebSocket"],"summary":"WebSocket RPC endpoint","description":"Upgrade HTTP connection to WebSocket for real-time RPC communication","parameters":[{"name":"Upgrade","in":"header","required":true,"schema":{"type":"string","enum":["websocket"]}},{"name":"Connection","in":"header","required":true,"schema":{"type":"string","enum":["Upgrade"]}}],"responses":{"101":{"description":"Switching Protocols - WebSocket connection established"},"400":{"description":"Bad Request - Invalid WebSocket handshake"}}}}}}
```

## WebSocket test page

> Returns an HTML test page for WebSocket RPC functionality

```json
{"openapi":"3.0.3","info":{"title":"Amadeus Blockchain API","version":"1.5.0"},"tags":[{"name":"WebSocket","description":"WebSocket RPC endpoints for real-time communication"}],"servers":[{"url":"https://nodes.amadeus.bot","description":"Mainnet"},{"url":"https://testnet-rpc.ama.one","description":"Testnet"}],"paths":{"/ws/rpc/test":{"get":{"tags":["WebSocket"],"summary":"WebSocket test page","description":"Returns an HTML test page for WebSocket RPC functionality","responses":{"200":{"description":"HTML test page","content":{"text/html":{"schema":{"type":"string"}}}}}}}}}
```


---

# 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.ama.one/http-api/websocket.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.
