各位,我使用 python 的 socketServer 做服务器,前端html里 用websocket请求,报错:
websocket failed: Error during WebSocket handshake: Invalid status line。
在手机端运行该html成功。代码如下:
ws = new WebSocket("ws://192.168.5.50:9947");
ws.onopen = function() {
//var relogin_data = JSON.stringify({"type":"re_login","client_name":"aaaaa"});
ws.send('init_user:socket_dewei');
};
ws.onmessage = function(e) {
console.log(e);
};
ws.onclose = function() {
console.log("onclose");
};
ws.onerror = function() {
console.log("onerror");
};
求问在python的 socketserver下 如何解决前段websocket连接问题 谢谢