Giter VIP home page Giter VIP logo

nodechat's Introduction

初学node.js和html5的相关技术(node方面大部分都是在cnodejs.org上面看技术文章学到的),想着学以致用,于是基于node.js和websocket来做了一个多人聊天室:

一、功能简介
1、用户随意输入一个昵称即可登录
2、登录成功后
 1) 对正在登录用户来说,罗列所有在线用户列表,罗列最近的历史聊天记录
 2) 对已登录的用户来说,通知有新用户进入房间,更新在线用户列表
3、退出登录
 1) 目前未支持直接退出,只能通过关闭网页来退出...
 2) 当有用户退出,其他所有在线用户会收到信息,通知又用户退出房间,同时更新在线用户列表
4、聊天
 1) 聊天就是广播,把信息广播给所有连接在线的用户
5、一些出错处理
 1) 暂时简单处理了系统逻辑错误、网络出错等特殊情况的出错提示

二、参考文章
1、websocket与node.js的完美结合( http://cnodejs.org/blog/?p=273 ) 。从这里了解到node-websocket-server 这个框架的,一个node.js和websocket通讯的框架,本程序中有使用到。
2、nodejs: 真正的一份代码,到处运行( http://cnodejs.org/blog/?p=702 ) 。从这里了解到如何在svr和client中同时复用部分代码,当然,本程序也模仿了这里面的技术来做,例如我源码里面svr/chatLib.js其实是同时被svr和client公用的。


微博交流:  http://weibo.com/zhengll

nodechat's People

Contributors

auzll avatar

Stargazers

 avatar  avatar WillmanYoung avatar Moruy avatar  avatar Bill-chan avatar  avatar WRT avatar  avatar  avatar

Watchers

James Cloos avatar 赵书剑 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.