GithubHelp home page GithubHelp logo

node-chat's Introduction

Nodejs聊天室

基于Socket.IO做的node聊天室。

主要功能有:

  1. 用户登陆进行聊天。
  2. 用户登陆后,即可发送消息。
  3. 对刚登录用户来说,罗列所有在线用户列表
  4. 对已在线的用户来说,通知该用户有新用户登陆或者离开
  5. 支持对所有人广播聊天内容,即群聊
  6. 支持私聊当前在线用户,即私聊
  7. 用户即时获得消息列表
  8. 当服务器断开连接时,提醒所有用户

使用方法

切换到此目录,运行node index.js即可。打开端口3000,localhost:3000

可以在本地打开多个窗口,分别运行localhost:3000,打开一个窗口并且输入用户名,观察这些窗口的变化。


说明

整个代码量非常少,可以根据自己的需求修改逻辑。

没有进行太多的限制,比如没有限制重名登陆,主要是关注聊天逻辑代码。

没有写任何样式,主要关注js逻辑。


功能截图

node-chat's People

Contributors

sevencai 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.