Castview

Ajith M Jose — Senior Frontend Developer

2026 · Solo build

Zero-install screen mirroring: run one command and mirror any Mac, Windows or Linux screen to another device's browser over the same wifi or a USB cable, no app install required.

Tech: Node.js, WebSocket, WebRTC, ffmpeg, npm CLI

Context

Built as an emergency fix for a laptop with a dead display — the only way to see the screen was to mirror it to another device fast, with nothing to install and no time to debug drivers. It grew into a general-purpose screen sharing tool, built and shipped end to end in a single day.

Features

  • One command, npx castview, starts sharing and opens a setup page with a per-network QR code, plus installs a desktop launcher for next time
  • Works over wifi or a plain USB cable: freshly plugged-in devices are auto-detected over their USB network interface within seconds, no restart needed
  • An optional low-latency mode captures the screen in-browser via getDisplayMedia and streams over WebRTC peer-to-peer at roughly 30fps, falling back automatically to a JPEG-over-WebSocket stream when WebRTC is not available
  • A random 4-digit session PIN is never embedded in the QR code, by design — it has to be typed once per viewer, and a --no-pin flag exists specifically for the "screen is dead, I cannot read a PIN" rescue case
  • Adaptive JPEG quality presets, tuned after measuring that a sharp full-quality stream at 15fps exceeded a typical wifi connection's real bitrate
  • The viewer supports pinch-zoom, auto-reconnect, screen rotation and keeps the viewing device awake

How it was built

Deliberately dependency-light: plain Node http and ws, screenshot-desktop for capture, qrcode for the pairing screen, and a shell-out to ffmpeg only when it is available, with no native compilation step required to install. Published to npm as castview so the entire tool is a single npx command away.

What is different

Most screen-mirroring tools assume both devices are already paired to the same account or app store. Castview assumes nothing except a shared network or a cable — which is exactly what you have left when the built-in display has already failed.

Live site

Source code