Back to Developer Roadmap

Websockets

src/data/question-groups/full-stack/content/websockets.md

4.0448 B
Original Source

WebSockets: A protocol for full-duplex communication between client and server over a single persistent connection.

Difference:

  • HTTP: Request-response model; client initiates every interaction.
  • WebSockets: Persistent, allowing real-time, two-way communication (e.g., live chat, notifications).

Example:

  • HTTP: Send a request for new messages repeatedly (polling).
  • WebSocket: Server pushes new messages as they arrive.