使用 AWS 和 Elastic Beanstalk 的 Websocket [英] Websockets with AWS and Elastic Beanstalk

查看:27
本文介绍了使用 AWS 和 Elastic Beanstalk 的 Websocket的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让我的 websockets 与 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/启用代理协议.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.

  1. 进入EB环境页面
  2. 配置
  3. 在负载平衡部分,将协议从 HTTP 更改为 TCP.

现在您可以点击 EB URL.

Now you can click EB URL.

这篇关于使用 AWS 和 Elastic Beanstalk 的 Websocket的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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