流星:WebSocket 握手期间出错:意外响应代码:400 [英] Meteor: Error during WebSocket handshake: Unexpected response code: 400

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

问题描述

WebSocket 握手时出错:意外响应代码:400 错误的可能原因是什么?

What could be the possible cause of the error Error during WebSocket handshake: Unexpected response code: 400?

该应用程序托管在 ubuntu 上,并使用 npm mup 包进行部署.我将捆绑的 ssl pem 文件包含在 mup.json 中.

The app is hosted on ubuntu and deployed using the npm mup package. I included my bundled ssl pem file within mup.json.

还有什么我需要在服务器上配置的吗?

Is there anything else that I need to configure on the server?

推荐答案

这可能由以下三个原因之一引起:

This can be caused by one of the three reasons:

  1. 某些 ISP 可能使用不支持 websocket 的代理.这在 3G 网络上更为明显

  1. Some ISPs may use proxies which don't support websockets. This is more apparent over 3G networks

如果您的应用崩溃了.Meteor 尝试连接到服务器,但无法连接,因为它不在线.

If your app has crashed. Meteor tries to connect to the server and can't since it's not online.

如果 Nginx 未配置为使用 WebSocket,并且您的 MUP 实例位于 WebSocket 后面,也会发生这种情况.

This can also happen if Nginx isn't configured to use WebSockets, and your MUP instance is sitting behind a WebSocket.

因此,如果您的应用程序按预期运行(可能只是需要太长时间才能连接)&在开发控制台中出现此错误可能是由于代理服务器.为避免这种情况,请尝试在您的服务器上安装 SSL (https://).这样 ISP 或代理就无法更改您应用的连接.

So if your app is working as expected (maybe just takes a bit too long to get connected) & has this error in development console it's likely due to a proxy server. To avoid this try getting SSL (https://) installed on your server too. This way the ISP or proxy is not able to alter your app's connection.

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

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