Node js - 创建持久的私人聊天室
最近读了很多关于 Node js 的文章,聊天功能看起来非常不错。然而,我见过的唯一的聊天示例基本上都是将聊天服务器广播到固定的 URL(如会议室)。是否可以部分使用node js来创建一个更像gchat的聊天客户端? - 在当前页面上弹出聊天窗口,然后在多个页面中持续显示。有人见过这样的例子吗?
如果没有,是否建议使用其他技术来实现此目的(我知道这已在其他问题中得到了回答)?
谢谢。
I've been reading so much a bout node js lately, and the chat capabilities seem very nice. However, the only chat examples I've seen basically broadcast a chat server to a fixed URL (like a meeting room). Is it possible to use node js in part to create a chat client more like gchat? - where a chat window is popped up on the current page and then persists through multiple pages. Has anyone seen an example of this yet?
If not, suggestions for other technologies to use for this purpose (I know that's been answered in other questions)?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我将为您提供一个依赖于 jquery 和 现在从解决方案中抽象出繁琐的 IO 和 DOM 操作。
我刚刚注意到,新版本的 nowjs (0.5) 已经构建了群组系统。这基本上可以满足您的需求。没有麻烦。
如果您愿意,可以删除 nowjs 依赖项并将其替换为 100/200 行代码。我将把它作为练习留给用户。
I'll give you a pseudo implementation relying on jquery and now to abstract away tedious IO and tedious DOM manipulation from the solution.
I only just noticed myself that the new version of nowjs (0.5) has the group system in build. This basically does what you want for you. No hassle.
If you want you can remove the nowjs dependency and replace it with 100/200 lines of code. I'll leave that as an exercise for the user.
看看 AjaxIM: https://github.com/freq32/AjaxIM
这是 facebook 风格基于nodejs的聊天应用程序(想想朋友列表、屏幕底部的小型持久聊天栏、弹出聊天)。
Take a look at AjaxIM: https://github.com/freq32/AjaxIM
This is a facebook-style chat application (think friends list, small persistent chat bar at the bottom of the screen, popup chats) based on nodejs.