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

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM