I have only small experience programming with web sockets, but I thought the ping pong mechanism is already built into the protocol. Does it have timeout? Does it help at the application layer?
Ref: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_...