Collaboration Phases
Collaboration and remote desktop are the same stack. The difference is one flag: can the viewer send input back?
Phase A: Chat Over Data Channels
Pion WebRTC data channels over the Nebula mesh. JSON messages on a reliable data channel. Chat appears as a side panel in FreedomDesktop.
No external signaling servers needed — two peers already have routable mesh IPs. TCP signaling on port 9100 between mesh addresses.
Phase B: Cursor Sharing
Peer cursor positions broadcast 10-20 times per second on an unreliable data channel. Colored dots appear on the viewer’s panels showing where their colleague is looking and clicking.
Phase C: Screen Sharing
Platform-native screen capture (ScreenCaptureKit on macOS, DXGI on Windows) feeds into H.264 encoding via OpenH264. Pion media tracks stream the video to peers over the mesh.
Phase D: Video Calls and Trust Ceremony
Camera and microphone via platform APIs (AVFoundation on macOS, DirectShow on Windows). The “I’ve met this person” button during a call creates mutual trust certificates — the video handshake.
Phase E: Remote Desktop
Screen sharing plus input forwarding. Keyboard and mouse events from the viewer are simulated on the remote machine. Click a peer in the mesh list, see their desktop, use their machine. No IDs or passwords needed — Nebula certificates ARE the identity.
Why One Stack
Every component serves both collaboration and remote desktop:
| Component | Collaboration | Remote Desktop |
|---|---|---|
| Peer connection | Connect to group | Connect to remote machine |
| Screen capture | Share my screen | Capture remote screen |
| Video codec | Encode for group | Encode for viewer |
| Camera | Video call | Not used |
| Input handling | Shared cursor (read-only) | Full keyboard and mouse |
Remote desktop is screen sharing plus one function call: input.ForwardEvent(). The entire remote desktop feature is a single boolean difference from screen sharing.