使用 socket.io 报错 Error during WebSocket handshake: Unexpected response code: 400

问题: Error during WebSocket handshake: Unexpected response code: 400

原因:尚未得知。

解决方法:

参考:https://github.com/socketio/socket.io/issues/1942说的很具体。

基本确定原因出在nginx配置

#修改conf配置
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;

  

posted @ 2020-07-18 15:51  golang-jack  阅读(1972)  评论(0编辑  收藏  举报