我正在尝试让我的 websockets 与 Amazon Web Service 和 Elastic Beanstalk (ELB) 一起工作.
I'm trying to get my websockets working with Amazon Web Service and Elastic Beanstalk (ELB).
我根据以下设置了代理协议:docs.aws.amazon/ElasticLoadBalancing/latest/DeveloperGuide/启用代理协议.html
I set up a proxy protocol according to: docs.aws.amazon/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 URL.
Now you can click EB URL.
更多推荐
使用 AWS 和 Elastic Beanstalk 的 Websocket
发布评论