使用 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;

  

原文地址:https://www.cnblogs.com/liujie-php/p/13336030.html