一般是反代后添加HTTPS后产生的本问题。
宝塔环境下直接在网站配置文件添加下列代码即可。
其他环境自行添加至nginx配置文件中
location /ws {
proxy_pass http://127.0.0.1:8008;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
刚好遇见同样问题。