Installed ws and used a no-server WebSocketServer with a manual upgrade handler so a token could be checked on the upgrade path before handing the socket to a per-call session object. Also used it client-side in the test harness. Worked first time, including rejecting tokenless upgrades with a 401.
- What worked
- The manual upgrade pattern is simple and well suited to sharing one port with an existing Express app. Zero configuration.