带有AWS和Elastic Beanstalk的Websocket [英] Websockets with AWS and Elastic Beanstalk
问题描述
我正在尝试使Websocket与Amazon Web Service和Elastic Beanstalk(ELB)一起使用.
I'm trying to get my websockets working with Amazon Web Service and Elastic Beanstalk (ELB).
我根据以下条件建立了代理协议: http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-proxy-protocol.html
I set up a proxy protocol according to: http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-proxy-protocol.html
我已经为所有IP在所有端口上打开了到负载均衡器和其他安全组的所有入站流量.
I've opened up all inbound traffic to my load balancer and other security groups on all ports, for all IPs.
我还在端口80上将负载均衡器列表器保持为HTTP.
I also kept the load balancer listerner as HTTP on port 80.
我的websocket连接尝试在端口80上连接时出现以下错误: 失败:WebSocket握手期间出错:意外的响应代码:400
My websocket connection gives the following error when trying to connect on port 80: failed: Error during WebSocket handshake: Unexpected response code: 400
端口8080上的此错误: 失败:建立连接错误:net :: ERR_CONNECTION_REFUSED
And this error on port 8080: failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
不胜感激建议,我现在停留在这个位置.
Would appreciate suggestions, I'm stuck at this point.
谢谢!
推荐答案
配置EC2安全组后,您的应用程序将使用公共IP.
After configuring EC2 Security group your application will work with public IP.
但是使用EB URL仍然会遇到问题. 要解决此问题,您必须更改EB配置.
But you still will get issue with using EB URL. To solve this issue, you have to change EB configuration.
- 转到EB环境页面
- 配置
- 在负载平衡"部分中,将协议从HTTP更改为TCP.
现在您可以单击EB URL.
Now you can click EB URL.
这篇关于带有AWS和Elastic Beanstalk的Websocket的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!