Error 502 when connecting to my project's websocket

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

1 Like

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

No, it throws 502 errors.

I fixed it by using express-ws.

1 Like

Having the same issue with websocket connection to glitch also. While in the past it worked flawlessy, now connection just fails with status 502. How does having to use express solve this?

1 Like

It could be a Glitch issue. Maybe try later?

1 Like

@glitch_support, where are they?

I am sorry that isn’t working for you now!

Recently, we made a decision to block ping services from our site as they were overloading our infrastructure. An unintended side effect is that some non-ping service IFTTT processes are also being blocked.

Our team is aware of this and investigating ways to prevent this from happening in the future. I don’t have an ETA on when that work will be done, but I have made a note to post an update in this thread once I get more info about this.

6 Likes

Any news on this front? Trying to create a Websocket echo server, which works if the client is connecting from a browser, but not if it is run from a backend, like another node.js process or a local app.

https://simple-websocket-echo-server.glitch.me
https://simple-websocket-client.glitch.me (doesn’t work)

This is so unfortunate, Gitch used to be great for these kinds of things! <3

Could you try this remedy for the backend variant

2 Likes

Thanks @wh0 ! I actually ran into this solution on a different thread, and worked like a charm! :slight_smile:

1 Like