Skip to content

Dead websockets connections don't reconnect when the app is behind an auth proxy #1389

@nirben82

Description

@nirben82

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:

  1. 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.
  2. 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.
  3. 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'}.
  4. This leaves the app in a disconnected state without informing the user or allowing them to re-authenticate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions