I have a webserver running on an EC2 instance behind an AWS load balancer under a custom domain for using https.
Curl requests to the webserver work as expected, including over https. But establishing a websocket connection fails with the following error (in Chrome):
WebSocket connection to 'wss://sub.foo.com/' failed: Unknown reason
While this is a cryptic error message, my guess is that this has to do with AWS, because:
- Establishing the socket with the server running on localhost works fine
- Establishing the socket with the server running on AWS by bypassing the load balancer works fine
I use Clojure's http-kit for the webserver, but suspect it doesn't matter.
Amazon says its load balancers support websockets, so what am I doing wrong?