Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
342 views
in Technique[技术] by (71.8m points)

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...