使用 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配置

1
2
3
4
5
#修改conf配置
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;

  

posted @   golang-jack  阅读(2101)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示