WebSocket 握手期间出现间歇性错误:意外响应代码:CloudBees 上的 400 [英] Intermittent Error during WebSocket handshake: Unexpected response code: 400 on CloudBees

查看:72
本文介绍了WebSocket 握手期间出现间歇性错误:意外响应代码:CloudBees 上的 400的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 CloudBees 上运行一个 websocket 应用程序 - 我间歇性地看到:

I am running a websocket app on CloudBees - and I intermittently see:

Error during WebSocket handshake: Unexpected response code: 400

我已经告诉它使用 http 1.1 来允许通过以下方式升级:

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

推荐答案

这几乎可以肯定是由于没有使用 https (SSL).基于普通 http 的 Websocket 容易受到在 http 层运行的中间(通常是透明的)代理的攻击,从而破坏连接.

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.

这在蜂窝网络或办公室网络中很常见,这些网络可能使用多个无线连接,并通过一个代理跨连接传播 http 请求.

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.

避免这种情况的唯一方法是始终使用 SSL - 这为 websocket 提供了最佳工作机会.

The only way to avoid this is to use SSL all the time - this gives websocket the best chance of working.

这篇关于WebSocket 握手期间出现间歇性错误:意外响应代码:CloudBees 上的 400的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆