when I use https,it case 'Error during WebSocket handshake: Unexpected response code: 400'
See original GitHub issueWhen I use http protocol no problem happened,but then I deploy my project on https protocol,it case ‘Error during WebSocket handshake: Unexpected response code: 400’,How to solve this problem? This is my nginx Config.
upstream site {
server 127.0.0.1:3000;
}
server {
listen 443;
charset utf-8;
client_max_body_size 75M;
ssl on;
ssl_certificate /etc/nginx/ssl/site_cert.crt;
ssl_certificate_key /etc/nginx/ssl/site.key;
location / {
include proxy_params;
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://site;
}
location /socket.io {
include proxy_params;
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://site/socket.io;
}
}
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
WebSocket connection failed: Error during ... - Stack Overflow
WebSocket connection failed: Error during WebSocket handshake: Unexpected response code: 400 · Ask Question. Asked 5 years, 11 months ago.
Read more >Error during WebSocket handshake: Unexpected ... - GitHub
Error during WebSocket handshake: Unexpected response code: 400 #1942 ... the lack of sticky session, in case you are using several Socket.
Read more >Error during WebSocket handshake: Unexpected response ...
WebSocket connection to 'wss://my_domain/openvidu' failed: Error during WebSocket handshake: Unexpected response code: 400. How can I fix this error?
Read more >Error during WebSocket handshake: Unexpected response code
Error during WebSocket handshake : Unexpected response code: 400. Hi,. I'm getting the following error when trying to update the data using websocket...
Read more >Got connection failed: Error during WebSocket handshake ...
... Error during WebSocket handshake: Unexpected response code: 400 ... It's work fine in Unity Editor, but failed to make a WebSocket ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I was facing this issue when using Elastic Beanstalk and an AWS load balancer.
Websockets travel over tcp, not http, so we needed to tell the load balancer to forward raw tcp instead of operating at the http layer.
Sorry to comment on a closed issue, but I hope this is helpful for some people.
@jarrai Hi, I am facing the same issue. Can you elaborate on how you rectified it? Thank You