#1392·mesop

Improve WebSocket probe to support non-redirect behaviours of corporate proxies

Author: nirben82Created May 7, 2026Updated May 7, 2026

Problem

The current WebSocket probe in #1391 detects session expiry by checking for opaqueredirect. This works for proxies that return a 302 Redirect on handshake. However, other proxies might:

  1. Return 200 OK but serve a login page HTML.
  2. Return 401 Unauthorized or 403 Forbidden. In these cases, the current check fails to detect that re-auth is needed.

Proposed Solution

Observe additional proxy behaviours (such as returning HTML on 200, or 401/403 status codes) and update the probeConnection logic in channel.ts to handle them accordingly.