WebSocket Timeouts
For operational and security reasons, we automatically close all WebSockets after 60 seconds of no activity
WebSocket connections between the client and our API Service are terminated if there’s no data transaction (NOT TCP level) for over 60s (a.k.a. idle for 60s). This termination is a normal behaviour initiated by the server side
Any transaction refreshes this 60 second timeout. For example;
If the user has
subscribeNewHead
to a network on our API service and the server sends a response for a new block every 12 seconds, the timeout window will be refreshed every 12 seconds (therefore no disconnection).If the user has
subscribeNewHead
to a network on our API service and the chain stalls, since no new responses for new blocks will be sent to the client, the timeout will occur after 60 seconds and the connection will be closed.If the user has subscribed to something less frequent (for example some data sent every 1 hour), once it reach the 60s timeout the connection will be closed.
We strongly recommend that customers expect that WebSocket timeouts and disconnections will occur and ensure that there is reconnection logic in their application.
Alternatively customers may want to implement their own keep alive mechanism, e.g. send a small request such as system_health
every 55 seconds at minimum.