websocket failed
各位,我使用 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连接问题 谢谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论