Aldee
Aldee

Reputation: 4528

AWS ElasticBeanstalk + Socket.IO + SSL issue

I'm having trouble working with AWS ElasticBeanstalk with NodeJS environment + Socket.IO + SSL for our messaging app.

I'm already running in circles trying to fix the issue but I always ends up to a Websocket handshake error (504 GATEWAY_TIMEOUT).


AWS Elastic Beanstalk Load Balancer configuration:

AWS Elastic Beanstalk Load Balancer configuration


ELB security inbound rule

ELB security inbound rule


Instance's security inbound rule

Instance's security inbound rule


Response error

enter image description here


Front end code

enter image description here

Thanks in advance. Any help is highly appreciated!

Upvotes: 4

Views: 2398

Answers (1)

Aldee
Aldee

Reputation: 4528

Finally!!! Got it!

So after a lot of hours burned, this solution works for me.

The problem is that I have HTTPS in my load balancer pointed to HTTP on my ec2 instance. That causes a problem because websocket runs on TCP and not HTTP/S. The port number also did matter in my case.


Original config (not-working)

enter image description here


New config (working)

enter image description here

I hope this can be of any help in the future. :-)

Upvotes: 7

Related Questions