Skip to content

engindemiray/realtime-chat-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Realtime Chat App

chat-app-image

Tech Stack

  • JavaScript
  • Node.js
  • Express.js
  • Socket.IO

Installation

Install npm packages:

$ npm install

Run the app with this command:

$ nodemon server.js

You may visit the application on browser with the URL: http://localhost:3000

Socket ID

Each new connection is assigned a random 20-characters identifier.
This identifier is synced with the value on the server-side.

// server-side
io.on("connection", (socket) => {
  console.log(socket.id); // x8WIv7-mJelg7on_ALbx
});

// client-side
socket.on("connect", () => {
  console.log(socket.id); // x8WIv7-mJelg7on_ALbx
});

socket.on("disconnect", () => {
  console.log(socket.id); // undefined
});

About

Realtime chat app with Node.js and socket.io

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published