I have a netty server running the atmosphere framework for a real-time notification system over websockets.
The system works perfectly on my local machine, but when I deploy it on EC2, It just does not seem to work. I am able to telnet to the remote Netty server though. The server is accessible and ports are open on EC2
Firefox throws the following error
Using URL: ws://beta.myapp.com:2880/myhandle?id=1&name=Chinese_food_rule_2& X-Atmosphere-tracking-id=35490c47-59d6-abf6-36fa-431aa340d90a&X-Atmosphere-Framework=0.9&X-Atmosphere-Transport=websocket&X-Cache-Date=0&Content-Type=application/json
Websocket error, reason: undefined
Firefox can't establish a connection to the server at ws://beta.myapp.com:2880/myhandle?id=1&name=Chinese_food_rule_2&X-Atmosphere-tracking-id=35490c47-59d6-abf6-36fa-431aa340d90a&X-Atmosphere-Framework=0.9&X-Atmosphere-Transport=websocket&X-Cache-Date=0&Content-Type=application/json.
Websocket closed, reason: Connection was closed abnormally (that is, with no close frame being sent).
The server does not even get a request, this leads me to think that this is some EC2 web sockets gotcha which I am not aware of.
A WebSocket API in API Gateway is a collection of WebSocket routes that are integrated with backend HTTP endpoints, Lambda functions, or other AWS services. You can use API Gateway features to help you with all aspects of the API lifecycle, from creation through monitoring your production APIs.
- In Control Panel, click Programs and Features, and then click Turn Windows features on or off. Expand Internet Information Services, expand World Wide Web Services, expand Application Development Features, and then select WebSocket Protocol. Click OK. Click Close.
I got this same issue in php.
The solution is: create websocket using your private ip
address of EC2. and connect that websocket using your EC2 public ip address or url with web socket port
you will get response from EC2 web socket
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With