1

First of all, I'm new to socket programming and AWS beanstalk. AS per my initial investigation I have founded AWS Elastic Beanstalk(EB) not support WebSocket. So I need to do a workaround on EB to enable that. I have developed a java application with one WebSocket request for notification. Its working fine in local machines when I deployed to AWS EB the WebSocket request-response 501 status code. I just investigate this issue I found we need to work around for enabling WebSocket request in EB. but I have no more idea how it does. I'm stuck in This situation. I Already have Load Balancer And security certificate.that are enabled on my EB. How can I enable WebSocket request without fail existing conditions?

I found One solution But I have doubt Where it put the configuration file described in this link Solution

Zub
  • 808
  • 3
  • 12
  • 23
Araf
  • 510
  • 8
  • 32

1 Answers1

1

I don't know about the java application you are running, but I know about how to setup your Elastic Load Balancer to work with websockets.

First of all, websockets doesn't work through CloudFront so you need to setup a separate domain (i.e. websockets.domain.com) that points directly to your load balancer, an A record alias.

Second, setup a new listener to your Elastic Load Balancer to use TCP and SSL. Generate a certificate through ACM.

enter image description here

Last, change your websocket client to use your new domain and port.

Gustaf
  • 1,299
  • 8
  • 16
  • Ok . i have one doubt whein call to he websoket how cai define the wesoket uri. Is it use new subdomain as prefix? – Araf Dec 13 '17 at 10:57
  • You need to set it up in Route 53 or wherever you host your domain. Then you need to call this domain with your websocket client. Make sure you use he correct port as well. – Gustaf Dec 14 '17 at 07:47