Hello everybody,
I am currently trying to integrate Websocket into my server running on an AWS Beanstalk NodeJS environment. Unfortunately I get the error message in the browser:
WebSocket connection to 'wss: // ***' failed: Error during WebSocket handshake: Unexpected response code: 404
Local (localhost) everything is running fine.
On the server side, I log the calls and see that the value "upgrade" has not been transferred in the header.
In the Beanstalk configuration, I have a Classic Load Balancer deposited with the following configuration:
- Port 443
- Protocol SSL
- Instance port 80
- Instance protocol TCP
- SSL Certificate: ...
In my deployment package is next to the server also the following file: .ebextensions / WebSocketsUpgrade.conf
with the following content:
container_commands:
enable_websockets:
command: |
sed -i '/\sproxy_set_header\sConnection/c \
proxy_set_header Upgrade $http_upgrade;\
proxy_set_header Connection "upgrade";\
' /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf
Have I missed something that needs to be configured?
Thanks a lot!