Elastic Beanstalk剥离Sec-WebSocket-Accept标头 [英] Elastic Beanstalk stripping Sec-WebSocket-Accept header

查看:109
本文介绍了Elastic Beanstalk剥离Sec-WebSocket-Accept标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在弹性beantalk上运行一个.NET Core应用程序,以从浏览器中的javascript接收websockets连接.

I'm trying to get a .NET Core application running on elastic beanstalk to receive websockets connections from javascript in the browser.

当我在本地计算机上的AWS外部测试客户端和服务器时,可以在两者之间建立Websocket连接.但是,当我将服务器部署到弹性beantalk时,出现以下错误

When I test my client and server outside AWS on my local machine I am able to establish a websocket connection betwen the two. But when I deploy the server to elastic beanstalk I get the following error

WebSocket connection to 'ws://52.62.253.144/' failed: Error during WebSocket handshake: 'Sec-WebSocket-Accept' header is missing

服务器回复了101交换协议,因此我知道服务器正在尝试建立连接,但是缺少Sec-WebSocket-Accept标头.在本地测试时,会显示此标头.

The server replies with a 101 Switching Protocols, so I know the server is trying to establish the connection, but the Sec-WebSocket-Accept header is missing. When testing locally, this header is present.

弹性beantalk是否有可能从响应中剥离Sec-WebSocket-Accept?当前,它是在单实例"方案中配置的,而不是自动缩放的.

Is it possible elastic beanstalk is stripping the Sec-WebSocket-Accept from the response? It is currently configured in a 'Single Instance' scenario, not autoscaling.

预先感谢

推荐答案

在Tomcat/Java项目中发生了同样的事情,最终通过将ELB协议切换为TCP/SSL进行了修复. 官方文档向您展示了如何切换它们,您可以尝试一下并让我知道吗.

Same thing happened to me in a Tomcat/Java project, it was finally fixed by switching the ELB protocols to TCP/SSL. The official documentation shows you how to switch them, can you try this and let me know.

这篇关于Elastic Beanstalk剥离Sec-WebSocket-Accept标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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