Websockets with AWS and Elastic Beanstalk

后端 未结 5 780
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-02 17:20

I\'m trying to get my websockets working with Amazon Web Service and Elastic Beanstalk (ELB).

I set up a proxy protocol according to: http://docs.aws.amazon.com/Elastic

5条回答
  •  情深已故
    2021-02-02 18:18

    I was also looking for possible workaround for this issue, but it's quite easy irrespective of what platform language you are using to develop websocket program on AWS EC2, as am using Node.js nginx in my case, this should work for all supporting platforms.

    Configure Security Group

    1. In the AWS console, open the EC2 tab.
    2. Select the relevant region and click on Security Group.
    3. You should have an elasticbeanstalk-default security group if you have launched an Elastic Beanstalk instance in that region for your app.
    4. click on Actions button at top, and select Edit inbound rules.
    5. here in Type column select All TCP, or you can set some Custom TCP rule as well to listen at your websocket port.

      And that's it!

    Note: If something is not working, check the "Events" tab in the Beanstalk application / environments and find out what went wrong.

提交回复
热议问题