打造一個socket.io chat app

https://www.youtube.com/watch?v=tHbCkikFfDE

socket.broadcast.emit
//送給特定socket

Homework的部分解法:

  • Broadcast a message to connected users when someone connects or disconnects
    //使用database
  • Add support for nicknames
    //加一個input
  • Don’t send the same message to the user that sent it himself. Instead, append the message directly as soon as he presses enter.
  • Add “{user} is typing” functionality
    //Listening onChange
  • Show who’s online
  • Add private messaging
    //socket.id
Show your support

Clapping shows how much you appreciated TzuYuan Liu’s story.