Send a ping. You can use ping messages to verify that the remote endpoint is responsive.
Example
A k6 script that initiates a WebSocket connection, sends a ping, and closes it using the onopen handler. The console should log connection is alive, since the recipient should automatically emit the pong event.
example-websocket-ping.js
The preceding example uses a WebSocket echo server, which you can run with the following command: