Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intermittent Error during WebSocket handshake: Unexpected response code: 400 on CloudBees

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).

like image 533
Michael Neale Avatar asked Jan 24 '14 23:01

Michael Neale


1 Answers

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.

like image 104
Michael Neale Avatar answered Nov 03 '22 02:11

Michael Neale