When leaving a Mesop application open for a long period (e.g., overnight) in a corporate environment behind a proxy with Single Sign-On (SSO), the WebSocket connection eventually drops due to session expiry.
When the app attempts to reconnect or send a message:
- The corporate proxy intercepts the request, sees that the auth cookie has expired, and attempts to return an HTTP 302 Redirect to send the user to the SSO login page.
- The browser's native WebSocket API does not follow HTTP redirects. If a WebSocket handshake receives anything other than a 101 Switching Protocols response, it immediately aborts.
- For security reasons, the browser does not expose the HTTP status code or location headers of the failed handshake to JavaScript; it just throws a generic, opaque WebSocket error: Event {isTrusted: true, type: 'error'}.
- This leaves the app in a disconnected state without informing the user or allowing them to re-authenticate.
When leaving a Mesop application open for a long period (e.g., overnight) in a corporate environment behind a proxy with Single Sign-On (SSO), the WebSocket connection eventually drops due to session expiry.
When the app attempts to reconnect or send a message: