Watch Together Server: Cross-Household Synced Playback with Rust, Axum and Steam Lobbies
A Rust server that lets people in different homes watch the same video at the same moment. Inside a home, the TV, the desktop app and the game join the same WebSocket room; homes connect to each other through a Steam lobby, without opening ports. Heavy work such as resolving, subtitles and remuxing happens on the server instead of the TV.
Performance & metrics
- A resolve cache with single-flight merging serves clients opening the same video with one request
- Steam only runs while a room is open; when nobody shares there's no extra process or traffic
- Shutdown is capped at 3 seconds and never leaves a hanging child process
Why I built it
People without the game had to be able to watch too. Smart TVs are too weak to resolve video sites, parse subtitles or stitch HLS streams, and asking families to forward ports or share IP addresses isn't realistic. So I wrote a node that runs in every home and sits quietly in the system tray: it does the heavy lifting, and only "which video, which second, playing or not" travels between homes.
Architecture & decisions
Written in Rust 2024 on axum 0.8 and tokio, it opens a single HTTP + WebSocket port; TVs on the same network find it through a UDP discovery reply. Room decisions are made in one place: the other household when it leads a global room, otherwise the connected game, otherwise the server's own clock. Media identity is a canonical URL and the rules match the mod's C# code exactly; Resolver::resolve routes to yt-dlp or the anime source by URL, caches the result and merges concurrent requests into a single flight. ffmpeg remuxes streams into fMP4 for the TV. The cross-household room is a Steam lobby built with steamworks, kept on a dedicated thread that only runs while a room is open. An access-key middleware, a Range-capable local library, a thumbnail cache and a Windows tray menu are part of the server as well.
Key features
- HTTP API and WebSocket room on one port, with ping and idle limits
- UDP discovery so TVs connect without typing an IP address
- Named, lockable global rooms with a household limit and friend invites over Steam lobbies
- yt-dlp, HLS and WebVTT/SRT parsing; fMP4 streams via ffmpeg for thin clients
- Local video library with Range requests and a thumbnail cache
- Downloads yt-dlp and ffmpeg with SHA-256 verification on first run; dated log files and a tray menu
Technical review
The Stardew mod can also start the server in --game mode as a hidden helper process: since the game is registered with Steam as Stardew, the lobby opens in a separate process, and when the game closes (even if it crashes) the stdin pipe closes and the helper shuts itself down. That small detail is what joined two separate processes without asking the player to install anything.
Written about this project
Related projects
Phone-Server: Real-Time Full-Duplex Voice Router & Jitter Buffer
A low-latency raw PCM audio streaming engine built on Tokio and Tungstenite. Features server-side echo mitigation and a client-side Jitter Buffer.
- Rust
- Dockerfile
- Tokio
- +5
Actix-Web Overlay Network Proxy Orchestrator
A high-performance, asynchronous WebSocket signaling and orchestration API built to securely manage and route distributed proxy nodes across Tor and Lokinet overlay networks.
- Rust
- Actix-Web
- Tokio
- +4
Networking & Protocols
Major project
Cyberia & Wired Protocol
A secure, decentralized operating system and network layer built on Wired — a custom, high-performance communication protocol. Instead of HTTP, it uses a mutually encrypted TCP handshake and AES-encrypted WebSocket payloads for strong data confidentiality.
- Rust
- C++
- Tauri
- +6
Need something similar?
I can build a system like this for you, too.
Describe your project in a few sentences, and we'll work out the right approach and an estimated scope together.