WebSocket connection failed: Error during WebSocket handshake: Unexpected response code: 400

后端 未结 16 1468
攒了一身酷
攒了一身酷 2020-12-04 21:08

I am trying to integrate Socket.io with Angular and I\'m having difficulties making a connection from the client-side to the server. I\'ve looked through other related quest

16条回答
  •  感动是毒
    2020-12-04 21:51

    Had the same issue, my app is behind nginx. Making these changes to my Nginx config removed the error.

    location / {
    proxy_pass http://localhost:8080;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
    }
    

提交回复
热议问题