Davi Augusto

en ptbr

Screenz: Simple, secure, screen sharing

My most recent personal project, Screenz, started out as a brief study of WebRTC technology but, once I found myself using it for practical purposes, I decided to share it.

You can access it at https://screenz.agst.dev.
You can also view its source code at https://github.com/agstrc/screenz.

What is Screenz?

Screenz is a straightforward web tool designed for one core purpose: sharing your screen with someone else easily and quickly. Forget complex installations or account setups. With Screenz, you can start broadcasting your screen with just a couple of clicks.

The process is simple:

  1. Click “Start Stream”.
  2. Share the unique “Streamer Code” provided with anyone you want to view your screen.
  3. They enter the code on the Screenz website and click “Watch Stream” to connect directly to your broadcast.

It’s built to be a direct, no-fuss solution, focusing on providing a secure connection with minimal delay between what you’re doing and what your viewers see. The goal is truly effortless screen sharing.

WebRTC

At the heart of Screenz is WebRTC—a powerful technology that enables real-time, peer-to-peer communication directly between browsers. WebRTC (Web Real-Time Communication) is not just a single protocol, but rather a collection of standards and APIs that allow audio, video, and data to flow securely and efficiently between users, without the need for intermediary servers.

What makes WebRTC especially compelling for screen sharing is its ability to establish direct connections between participants. This minimizes latency and maximizes privacy, since your screen data doesn’t pass through a central server. Instead, browsers negotiate a connection using a process called signaling, and then exchange information using protocols like ICE (Interactive Connectivity Establishment), STUN (Session Traversal Utilities for NAT), and DTLS (Datagram Transport Layer Security) for encryption.

Signaling is the initial process where peers exchange information (such as network details and media capabilities) required to set up the peer-to-peer connection. This is typically done through a lightweight server that simply relays these setup messages between users. Importantly, once the connection is established, all actual screen data flows directly between browsers, bypassing the server entirely.

Because WebRTC is peer-to-peer, hosting Screenz was straightforward: my server only needs to handle the signaling phase, which is a minimal and transient load compared to relaying video streams. This architecture makes it easy and cost-effective to provide the service, since the server is not a bottleneck for bandwidth or performance.

All major browsers support the WebRTC API, making it possible to build robust, cross-platform applications like Screenz. While the underlying technology involves a complex interplay of networking and multimedia protocols, the end result is a seamless experience for users: fast, secure, and reliable screen sharing with just a few clicks.

If you’re interested in diving deeper into how WebRTC works, I highly recommend WebRTC for the Curious, which offers an excellent technical overview.