Ping
Cloud-API and Go Gateway provide a WebSocket ping request that can be used to measure the latency from the endpoint and to keep the WebSocket connection alive.

REQUEST

Method: ping
Parameters: None

Examples

Cloud-API
Go Gateway
1
wscat -c wss://api.blxrbdn.com/ws --header "Authorization: <YOUR-AUTHORIZATION-HEADER>"
2
> {"id": 1, "method": "ping", "params": null}
3
< ......
Copied!
1
wscat -c ws://127.0.0.1:28333/ws --header "Authorization: <YOUR-AUTHORIZATION-HEADER>"
2
> {"id": 1, "method": "ping", "params": null}
3
< ......
Copied!
We assume that the Gateway IP is 127.0.0.1 with ws port 28333

RESPONSE

Result Fields

Result Field
Description
pong
The UTC time (in microsecond format) that WS server receives ping request.

Example

1
{
2
"jsonrpc": "2.0",
3
"id": "1",
4
"result": {
5
"pong": "2021-10-20 17:53:54.950292"
6
}
7
}
8
​
Copied!
Last modified 24d ago
Copy link