Skip to content

andrekubotsu/socketio-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Socket.io PoC implementation back and front

How does it work?

Socket.io uses websocket connection, it means that the communication between server and client stays alive, otherwise, it would be necessary to make as many connections as the application needs what would be really bad as the application grows.

Server <== Websocket ==> Client

Great features:

  • it´s possible to send messages to all users (broadcast) that aren´t delivered to who sent;
  • it´s possible to open communication between client and server to pass some callback
  • it´s possible to join multiple rooms and the socket.id is a room by itself (private messages)
  • it´s possible to use namespaces to some auth strategy

Interesting resources

How to run:

  1. This project is using:

    • client: vite + yarn
    • server: nodemon + npm
    • why? just because it is... (no special reason for)
  2. Client:

  3. Server

    • server folder
    • run npm i
    • run npm start
    • server running at port 3002
  4. You can open as many clients that you want to test various scenarios

  5. Enjoy!

About

Just a Socket.io PoC implementation using node (server) and react (client)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published