Skip to content
ALL LABS
LAB 02Live environment

The 1:1 connection lab

Take one peer connection apart: capture media, negotiate signaling, watch ICE choose a path, inspect getStats, send data, then break the path on purpose. Automatic rooms, manual SDP, and a solo loopback all share the same wire.

Lesson 03 — How WebRTC connects
IDLESOLO FRIENDLY2 TABS OR 1

Media stage

NO LOCAL TRACK
NO PEER PATH

Start the camera or use the synthetic test feed. Local media never leaves the browser until a peer connection carries it.

Local
permission has not been requested

Join a room or complete a manual exchange. Remote media appears only after the peer connection is connected.

RemoteNO PEER CONNECTION
the other side's tracks arrive after ICE and DTLS
SIGNALING IDLEPEER NEWICE NEWDATA CLOSEDSIGNALING VIA WS

Capture controls

Permission is requested only when you press a button.

Input level
0%

Connect two peers

NO PEER CONNECTION

2–40 letters, numbers, _ or -. No account, no display name, no personal information.

You

not joined

Room

—

Other peers

waiting

The newcomer offers to the existing peer. When signaling drops, an established media path should survive — signaling is only how the two sides find each other.

Signaling messages appear here once you join a room or exchange a manual offer.

Data channel

SCTP over DTLS · ordered chat and chunked file transfer

NOT OPEN

The chat unlocks when the data channel opens after DTLS.

5 MB LAB LIMIT · 8 KB CHUNKS · BACKPRESSURE AWARE · NO SERVER STORAGE

Break it

Filters apply to outbound candidates on the next negotiation.

Host, srflx, and relay candidates are all usable. The selected pair may be direct or relayed.

Connection should stay stuck in checking.

Killing signaling does not close an established media path. Reset the peer connection to force a new gather.

Completion

Record the 1:1 lab

Complete at least one connected peer path and open the data channel, then record the lab. You can keep experimenting afterward.

0 / 4 LABS · 0 / 15 LESSONS
CERTIFICATE REQUIRES ALL 4 LABS

Lab: do and don't

PRODUCTION HABITS

Do

  • Wait for ICE before judging a connection

    new → checking → connected takes time and candidates. State 'checking' is not a verdict; getStats and the ICE log tell you what is actually happening.

  • Keep signaling and media separate

    The data channel and RTP do not travel through your WebSocket. Killing signaling should not kill an established call; if it does, the app is coupling the two.

  • Stop tracks and close PCs

    Camera LEDs stay on when tracks are alive. Close the peer connection, stop every track, and clear timers when the user leaves.

Don't

  • Don't trust a single STUN server

    STUN only discovers an address; it does not relay. Networks that block UDP or use symmetric NAT need TURN, and TURN must use short-lived credentials.

  • Don't send files blindly

    Watch bufferedAmount and pace chunks. A fast producer can grow the SCTP send buffer until memory and latency suffer; the lab waits for the low-water mark.

  • Don't hide permission failures

    NotAllowedError, NotFoundError, and NotReadableError are different problems. Name the cause, then offer the synthetic feed instead of a generic failure.