Error 502 when connecting to my project's websocket

On my project!/fragrant-cake, I’m trying to connect to wss:// on port 3000 (which is process.env.PORT) but I keep getting this error: WebSocket connection to 'wss://' failed: Error during WebSocket handshake: Unexpected response code: 502.
Could anyone help me? Thanks

The process.env.PORT is just an internal redirect thing, can you get the desired result using the wss:// url?

No, it throws 502 errors.

I fixed it by using express-ws.

1 Like