feat: listen to the "offline" event
feat: listen to the "offline" event

The connection will be closed once the "offline" event is emitted by
the browser, in order not to wait for the heartbeat mechanism to detect
the disconnection.

Reference: https://developer.mozilla.org/en-US/docs/Web/API/Window/offline_event

Related: https://github.com/socketio/socket.io-client/issues/1433

socketio/engine.io-client,Automattic/engine.io-client,socketio/engine.io-client,socketio/engine.io-client