WebSocket is a protocol for transferring data between a client and a server. Unlike HTTP, WebSocket:
- Is bidirectional: client and server can send data to each other at any time. And HTTP is unidirectional — the server sends data only at the request of the client; it can not send anything without a request.
- Establishes one connection and keeps it open permanently. HTTP establishes a new connection every time the client makes a request and breaks it after the server responds.
Websocket is used to provide real-time data updates or to send messages to the client. For example, for the work of social networks: when someone writes to you the server delivers the incoming message via WebSocket. If social networks were running on HTTP you would have to refresh the page every time to check for new messages.
WebSocket option in our CDN
By default, the ability to open WebSocket connections is:
- Enabled for resources that work through DNS and deliver the content of the entire site through CDN servers (acceleration type is "accelerate and protect entire site")
- Disabled for resources that deliver only static files through CDN servers (acceleration type is "accelerate and protect only static assets")
For any resource, you can turn off and turn on the option in the settings, section "Content":