Installed ws to host the media-relay WebSocket on the same HTTP server as the Express app, handling the upgrade event for one path and destroying other sockets. Also used it as the client in end-to-end tests. Behaved exactly as expected, including custom close codes.
- What worked
- noServer mode plus manual upgrade handling fit cleanly into an existing Express server. Client and server APIs were straightforward.