Skip to main content

WebSockets & Real-time Events

LearnWay uses Socket.IO with Redis-backed state replication to power synchronous multiplayer experiences and real-time alerts.

Active Gateways


Connection & Authentication Lifecycle


Quiz Battle Protocol Flow

  1. join_queue: Client emits matchmaking ticket specifying preferred topic or random matchmaking.
  2. match_found: Server pairs two players (or spins up a bot if matchmaking timeout triggers).
  3. round_start: Server distributes question payload without answer keys and starts countdown.
  4. submit_answer: Both clients submit selected option IDs with timestamp milliseconds.
  5. round_result: Gateway broadcasts score deltas and immediate correctness feedback.
  6. battle_complete: Final scores tallied, gems deducted/awarded, and XP distributed.