info - 未处理的 socket.io url
我正在开发一个 socket.io + node 项目。 就像在这个页面中一样, http://davidwalsh.name/websocket 我在 socket.io v7 中收到“信息 - 未处理的 socket.io url”错误。但我在 v6.17 中没有收到此错误?您对这个错误有什么想法吗?
谢谢
I working on a socket.io + node project.
Just like in this page, http://davidwalsh.name/websocket
I am getting "info - unhandled socket.io url" error in socket.io v7. But I dont get this error with v6.17? Do you have any idea with this error?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
几天前就遇到了确切的问题,看起来 socket.io 对 API 进行了一些更改。
我有一个 socket.io 发送和接收消息的工作演示 - 上传到 https://github。 com/parj/node-websocket-demo 作为参考
本质上有两个更改
在服务器端 - 将
socket.on
更改为socket.sockets.on
在客户端 - URL 和端口不需要,因为它是自动检测到的。
注意:您还可以在客户端使用
io.connect("http://:")
,但是,不再需要,因为它是自动检测的,以下是确切的信息变化 - https://github.com/parj/node-websocket-demo/commit/5ba52db9d1a5b7e8a3af5839adcd12768741dc97
这已经使用 Express 2.5.2 和 Socket.io 0.8.7 进行了测试
Had the exact issue couple of days back and looks like socket.io had some changes in the API.
I have a working demo of socket.io sending and receiving a message - uploaded to https://github.com/parj/node-websocket-demo as a reference
Essentially two changes
On Server side - changed
socket.on
tosocket.sockets.on
On Client side - URL and port not required as it is autodetected.
NOTE: you can also
io.connect("http://<ip>:<port>")
on the client side, however, not required anymore as it is autodetectedHere are the exact changes - https://github.com/parj/node-websocket-demo/commit/5ba52db9d1a5b7e8a3af5839adcd12768741dc97
This has been tested using Express 2.5.2 and Socket.io 0.8.7