PLOXX
FRENESDEITNL
← Blog

How does a random video chat work?

A technical dive behind the scenes: matchmaking, WebRTC, peer-to-peer, signaling. Everything that happens between your click and your first match.

You click "Start", and moments later you are talking to a stranger. 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. The server puts you in a queue: on PLOXX there is only one, the same for everyone.

The algorithm pairs two people waiting in that queue. On PLOXX, matches run every evening from 9pm to 11pm (Paris time), when everyone plays at once.

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, if you are 15 to 17, that TURN relay is used for every one of your video calls, not just as a fallback: your IP address stays hidden from 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.

Frequently asked questions

How are two strangers connected?

A queue server pairs them, then their browsers negotiate an encrypted WebRTC video connection. The server introduces them; when it relays the stream, it cannot read it.

Why does the wait vary so much?

It depends on how many people are queuing at that moment. That is why several platforms concentrate activity into time slots rather than leaving the queue open permanently.

What happens when you skip to the next person?

The connection is closed on both sides and nothing of the conversation is kept. That is also what makes reporting useful: without it, no trace of a problem behaviour remains.