You click "Start", and 2 seconds later you are talking to a stranger on video. Magic? Not quite. Let us take the technical machinery apart.
Step 1: matchmaking
When you start a session, your browser opens a WebSocket connection to the PLOXX server. You send your criteria (chat or video mode, language, interests, gender preference). The server puts you in a queue.
The algorithm looks for another waiting user with compatible criteria. PLOXX uses multi-phase matching: first language + a shared tag, then language alone, then tag alone, and finally any compatible partner. That order maximises quality without leaving anyone waiting forever.
Step 2: signaling
Once two users are matched, the server sends them a "matched" message. At that point they are not connected directly yet. The server acts as a relay so they can exchange what is needed to establish a peer-to-peer connection: that is signaling.
The two browsers exchange SDP offers/answers and ICE candidates through the WebSocket server. Those messages describe their capabilities (supported video codecs, audio formats, network addresses).
Step 3: WebRTC
WebRTC (Web Real-Time Communication) is the web standard for real-time communication. Once signaling is done, the two browsers establish a direct connection and stop going through the server.
That matters for two reasons:
- Latency: peer-to-peer video arrives in 20-100 ms, against 200-500 ms through an intermediate server.
- Cost: a server does not have to push tens of Mbps of video for every single conversation.
Step 4: STUN/TURN servers
The problem: most users sit behind a NAT router (the home internet box). Their "public" IP is not directly reachable. That is where STUN servers come in: they let a browser discover its real public IP address and external port.
When the NAT is too strict (around 10% of cases), STUN is not enough. You then need a TURN server to relay the traffic. It costs bandwidth, but it is essential for anyone on a corporate network or a restrictive mobile carrier.
On PLOXX that TURN relay is forced for every video call, not just as a fallback: your IP address is never exposed to the stranger in front of you. The video stays end-to-end encrypted - the server cannot see it - at the cost of a little more server bandwidth.
Step 5: moderation
The challenge: because the video is end-to-end encrypted, the server never sees it. So how do you moderate? PLOXX combines several approaches:
- A structured reporting system with reasons (nudity, hate, minors…)
- A snapshot of the remote camera sent at the moment of the report (and only then)
- Human moderation with automatic priority on critical reasons
- IP bans, quickly reversible if a mistake is made
In short
A modern random video chat is a mix of: WebSocket for matchmaking, WebRTC for peer-to-peer video, STUN/TURN to cross NATs, and a human-plus-automatic moderation system for safety. All of it plays out in a few seconds, invisible to the user.