open的时候报错
wx.onSocketOpen(function(res){
console.log("WebSocket连接已打开!");
});
先停止Nginx (windows 版)
tasklist | findstr nginx(查看nginx进程)
taskkill /pid xxxx /F (杀进程)
location /st2 {
root html;
index index.html index.htm;
proxy_pass http://xxxxxxxx:xxxx/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
加上这三句
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
问题解决(这是其中一种情况)