I am running a websocket app on CloudBees - and I intermittently see:
Error during WebSocket handshake: Unexpected response code: 400
I have told it to use http 1.1 to allow Upgrades via:
bees app:proxy:update http_version=1.1
And it works, but I sometimes see the error (not always).
This is almost certainly due to not using https (SSL). Websocket over plain http is vulnerable to proxies in the middle (often transparent) operating at the http layer breaking the connection.
This is common on cellular networks, or office networks that may use multiple wireless connections with a proxy that spreads the http requests across connections.
The only way to avoid this is to use SSL all the time - this gives websocket the best chance of working.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With