Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.1 KB

README.md

File metadata and controls

45 lines (31 loc) · 1.1 KB

Contents

  • backend in Nest.js
    • server-sent events endpoint
    • websockets endpoint
  • frontend in React
    • server-sent events implementation
    • websockets implementation

Setup

  1. pnpm i
  2. pnpm dev
  3. Go to localhost:3001

Server-Sent Events (SSE)

  • only one way communication (server to client)
  • simple to implement and use compared to WebSockets. It’s built on standard HTTP protocols and doesn’t require special handling for connections.

Resources

WebSocket

  • bi-directional communication between client and server
  • suitable for interactive apps
  • low latency
  • more complex setup

Example use cases

App needs to receive and send data in real-time

  • collaborative tools (Figma, document editing)
  • games
  • trading
  • chat

Resources