web
web copied to clipboard
`dev-server-core/WebSocketsManager`: send periodic ping over WebSockets to prevent connection closure for inactivity
What I did
- Added pinging mechanism over the web sockets to prevent unexpected connection closure after ~60s (with websocket error
1006
) when testing on BrowserStack (Safari).
I couldn't get to the bottom of what exactly is causing the timeout, but sending periodic ping messages fixes it. I checked if the ws
server is closing the connection, but it doesn't seem to be the case; using a ping to keep the connection alive is suggested here.