Repository navigation
Home
Rituraj edited this page Oct 24, 2026
·
20 revisions
Rein is an open-source, cross-platform remote input system and screen mirror that transforms any phone, tablet, or browser into a powerful wireless trackpad, keyboard, gamepad, and desktop screen mirror for your desktop. Built with a TypeScript WebRTC engine (werift), native platform input drivers, and GStreamer video and audio capture, Rein delivers low-latency trackpad, keyboard, virtual gamepad controller, clipboard synchronization, bidirectional file sharing, and live desktop screen and audio mirroring over local networks with zero cloud dependency.
Launch.vid.mp4
| Section | Description |
|---|---|
| Architecture Overview | End-to-end system design, werift WebRTC single-peer connection, dual data channels, and system data flow |
| Server Architecture | Vite middleware & Nitro server architecture, WebRTCManager, UdpSocketManager, and SseTransport log streaming |
| Signaling Architecture | HTTP REST & Server-Sent Events (SSE) signaling protocol (/api/rtc/*), session lifecycle, and ICE exchange |
| Input System | Gesture recognition, dual DataChannels, virtual gamepad controller, absolute pointer / touchscreen mode, and clipboard sync |
| Screen & Audio Streaming | GStreamer H.264 & Opus pipelines, dual UDP relays (ports 5004/5006), stream quality presets, and capture providers |
| Platform Drivers | Cross-platform @imxade/inject drivers for Linux (uinput), macOS (CoreGraphics & IOHIDUserDevice), and Windows (SendInput, Synthetic Pointer, & ViGEmBus) |
| Authentication & Security | Authentication flow, timing-safe token verification, file transfer boundaries, and local network security model |
| Electron Wrapper | Desktop application architecture, single instance lock, utility process server launcher, and packaging |
| Development Guide | Building, running, testing, code standards (Biome), and contributing to Rein |
| Configuration Reference | Server (src/server-config.json), user config paths, stream quality, and client local storage settings |
| API Reference | Complete REST API, SSE streams (/api/rtc/session-sse, /api/debug/logs, /api/files/events), and DataChannel protocol reference |