Matchmaking Vibe (Connect)
The heart of Haven is its high-speed Matchmaking Engine. It connects two souls instantly across the globe for a direct, high-fidelity experience.
🧬 The "Connect & Vibe" Engine (2026)
Unlike early prototypes which relied on heavy database polling, the current Haven engine is a dedicated WebSocket Pulse microservice.
Why We Migrated:
- Massive Concurrency: The WebSocket Pulse handles 10,000+ simultaneous connections without breaking a sweat.
- Speed: In-memory matching occurs in <5 milliseconds.
- Safety: Real-time signal relay ensures faster WebRTC handshakes and instant disconnection sensing.
🚦 The Connection Process
When you click "Drop In":
- Pulse Handshake: The client establishes a secure path to
NEXT_PUBLIC_MATCHMAKING_WS_URL. - Preference Match:
- Buddies First: The server prioritizes pairing you with an online "Buddy" (mutual connection) if they are also in the queue.
- Global Pool: If no buddies are waiting, you are added to the general vibe pool.
- The Session:
- Once a pair is found, the Pulse generates a unique
sessionId. - Both clients receive a
match_foundmessage containing their partner's identity. - DB Handover: At this point, the session is logged to Supabase to prepare for message persistence and call logs.
- Once a pair is found, the Pulse generates a unique
🛡️ Real-time Safety
During the search and call:
- Instant isolation: If a user is reported, the Pulse immediately isolates the reported ID in memory for that session.
- Auto-Ban Score: Multiple reports across different sessions trigger a score-based exclusion from the vibe pool to protect the community.
⚡ Technical Benchmarks
- Time-to-Queue: ~20ms.
- Matching Latency: <5ms.
- Relay Performance: Sub-2ms for WebRTC signals.
Created by the Haven Matchmaking Bureau.