A handler for a WebSocket connection ping event. For multiple, simultaneous event handlers, use WebSocket.addEventListener().
Example
A k6 script that initiates a WebSocket connection and sets up a handler for the ping event.
example-websocket-onping.js