A WebSocket is a TCP-based communication protocol designed to exchange real-time messages between a browser/client and a web server. This makes the WebSocket protocol great for applications like live chats, messaging apps, gaming, and news or stock tickers.
Unlike the HTTP protocol, the WebSocket protocol is bidirectional, and typically initiates from ws:// or wss://. Once the WebSocket handshake has been made, the connection between the client and server will be kept open until it is terminated by either party.
Dotcom-Monitor checks a single WebSocket URL for availability, performance, proper content, and errors. The monitoring device can also be configured to validate SSL certificates and message response content.
Once the connection has been established, the monitoring check listens to the events in the socket. If the message or data needs to be sent in string or binary format, Dotcom-Monitor will send the message to the target endpoint using the WebSocket protocol and will wait for the response.
To validate a message string received from the WebSocket, the system will wait for the response from the target endpoint and check the received message for the presence of the specified keyword in the string until the monitoring task completion timeout is reached.