Is it possible to monitor the y-websocket connection status

I am using the y-websocket "version": "1.5.0" as the server side. Now I facing a issue that, when the client editor opened for a long time, it seems the sync did not work(maybe offline), when I refresh the page or reconnect the websocket it works. this always happen when the connection established for a long time.

To fixed this issue, I want to monitor the y-websocket connect status. show the conenct status in the UI(connected and active is green or disactive is turn to red). If the connect did not active anymore, do some action(auto reconnect or talk to user to refresh the page).

is it possible? what should I do? I can not detect the websocket ping-pong works or not , it seems implement the ping-pong by browser.

wsProvider.on('status', event => {
  console.log(event.status) // logs "connected" or "disconnected"