WebSocket

## Normal client-server connection : 

Problem for chat application :

Solution

In socket.io we pass at the header (ws) websocket update our connection .

io.on('connection',(socket)=>{
   socket.on('user-message',(message)=>{

    io.emit('message',message);

   })
})

How to install this project

  • clone this project.
  • npm install
  • npm start -It will start at localhost3000