Open manikandants opened 8 years ago
AFAIK, AWS ELB does not support WebSocket.
Thanks @lpinca That's a bad news for me :( How is the support for any other transformers like Socket.io/Sockjs/Engine.io?
It might work but you'll be limited to the polling transports. Take a look at this old issue https://github.com/primus/primus/issues/87.
Thanks for the info. I'm trying out the proxywrap module. I'll explore and update on the issue.
So i might be misunderstanding the issue, sorry if i am way off.
But I have been running the WS module on Elastic Beanstalk with Primus in production for over a year, without any problems. Using the node cluster module to scale out and ELB to handle https.
Have you tried setting the proxy server to "none": On Elastic Beanstalk goto Configuration > Software Configuration > Container Options: set Proxy server: none.
By the way i have had problems installing the ws module on newer version of node on Elastic Beanstalk, so i would recommend staying on node 0.12.6 and ELB node v2.0.8
@ddennis My proxy server is set to "none" in container options. I am still on ELB v2.0.0 running nodejs 0.12.6. Have you enabled proxy-protocol as mentioned in aws documentation? What is the listener configuration and security group configuration that is working for you? I have application server running on port 80 and websockets running on port 9001. I have opened both ports in security group, added TCP listener for port 9001, enabled proxy protocol as mentioned in the link above and included proxywrap as well. But still client is not able to connect to websocket. I probably am missing some silly thing. but couldn't figure out the same.
You can find my configuration with screenshots in stackoverflow
@manikandants I have not enabled the proxy-protocol, or included proxywrap.
Configuration > Software Configuration > Container Options
TCP Listener is added in the Elastic Load Balancer configuration.
security group of the instance
Thanks. I'll disable proxy and try it.
Thank you for the help @ddennis. @manikandants any luck so far?
Nope. The requests are reaching the loadbalancer, but not the ec2 instances behind it. We have temporarily created an ec2 instance just to handle messaging, along with the load balanced application server until we figure out the issue/our userbase get big enough to overload the ec2 instance.
@manikandants I managed to get websockets (https://github.com/websockets/ws) working on both port 80 and 8080 on ELB with the configurations below.
Security group:
Load balancer listeners:
Container options:
Load balancer:
Hello, i have same Problem. Wir have nodejs App with Primus. If I try to make tcp connection over Port 80 and 443 works sockets but the page dies not work. If I try to make the connection over https work the page, but sockets does no work. I try to activate Proxy protocol, does not help. Has anyone ideas?
AWS now seems to support Websockets: https://aws.amazon.com/blogs/aws/new-aws-application-load-balancer/
Version: 4.0.5
Environment: AWS Elasticbeanstalk
Expected result:
Actual result:
Steps to reproduce: I have a node.js application server and I recently added realtime messaging through Primus websockets transformer. It works well in single instance. I deployed the messaging to production environment (AWS Elastic beanstalk) and added websocket port to security group. But the client requests doesn't reach the instance. Has anyone used primus with websockets behind AWS ELB? Please let me know what needs to be done to enable the communication