测试的HTML代码如下
结果:server start… connected…但是网页上居然输出:close? 为什么?是不是指建立了一下链接就断了,该怎么弄才行
如果是chrome的话,可能是这个错误:
Error during WebSocket handshake: 'Sec-WebSocket-Accept' header is missing
另外,调试信息的输出,可以用console, document.write 太粗暴了哇
作者对这个问题的回复: https://github.com/miksago/node-websocket-server/issues/72
用socket.io吧。。。
CNode 社区为国内最专业的 Node.js 开源技术社区,致力于 Node.js 的技术研究。
如果是chrome的话,可能是这个错误:
另外,调试信息的输出,可以用console, document.write 太粗暴了哇
作者对这个问题的回复: https://github.com/miksago/node-websocket-server/issues/72
用socket.io吧。。。