STN-01
STN-01 is a small proof of concept for an ephemeral, direct browser-to-browser WebRTC broadcast. This first brick connects one publisher to one viewer. It has no media server, storage, recording, accounts, or analytics.
The pages exchange WebRTC session descriptions manually by copy/paste. ICE candidates are gathered into each description before it is displayed, so no signaling server is needed. The public Google STUN endpoint is used for NAT discovery; audio and video flow directly between the two browsers.
Run locally
Camera and microphone access requires a secure browser context. Browsers treat
http://localhost as secure, so serve this directory instead of opening the
HTML files directly:
cd cygnus_x1/labs/STN-01
python3 -m http.server 8000
Open these pages (in separate browser windows or devices):
- Publisher: http://localhost:8000/publisher.html
- Viewer: http://localhost:8000/viewer.html
If the viewer is another device, serve the pages over HTTPS from a hostname the
device trusts. Plain HTTP on a LAN IP usually cannot use getUserMedia().
Complete the handshake
- On
publisher.html, press Start Broadcast and allow camera/microphone access. - Wait for the offer, copy it, and paste it into
viewer.html. - On
viewer.html, press Connect / Watch. - Wait for the answer, copy it, and paste it into
publisher.html. - Press Apply Answer. The status should progress to
connected, and the viewer should receive the live stream.
The copied JSON contains SDP plus gathered ICE candidates. It is control data, not media. For a quick local test both pages can run on one computer. To prove NAT traversal, test on two networks and exchange the text through any channel you choose.
Limits of this first pass
This UI establishes one viewer session. The publisher creates one
RTCPeerConnection and adds its camera and microphone tracks to it. Supporting
five viewers means repeating that connection and offer/answer exchange once per
viewer; media still does not pass through signaling infrastructure.
Some network combinations will fail without TURN. TURN is intentionally absent until direct connectivity has been tested and shown insufficient. Restart the broadcast to create a fresh session after a failed or closed connection.