Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebSocket Chat (Socket.IO)

A tiny real time chat app using Node.js, Express, and Socket.IO.

What be included

  • Send messages: type and hit Send
  • Live receive: other tabs get the message instantly
  • Typing indicator: shows bouncin dots while a user be typin
  • Auto scroll: keeps the latest message in view without stretchin the panel

Requirements

  • Node.js (any modern LTS be fine)

Run it

Install deps:

npm install

Start the server:

npm start

Open:

  • http://localhost:3000

To test chat proper, open two tabs and send messages between em.

Project map

  • index.js: Express server + Socket.IO events
  • public/index.html: UI and Socket.IO client code

Socket events

  • Client to server

    • user:message { text }
    • user:typing { typing: true|false }
  • Server to client

    • server:message { text }
    • server:typing { id, typing }

Notes

  • Static files be served from public/
  • If port 3000 be taken, free it up or change the port in index.js

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages