Skip to content

Configuration Reference

pinjinx edited this page Oct 23, 2026 · 2 revisions

Rein configuration is divided into Server Configuration (persisted on the host desktop) and Client Settings (persisted in viewer device localStorage).


Server Configuration

Resolution & Persistence Priority

Rein reads initial defaults from src/server-config.json and writes user overrides to a user-owned writable configuration file so application bundles remain unmodified.

The writable directory is resolved in the following priority order via src/utils/configHelper.ts:

  1. REIN_DATA_DIR environment variable (e.g. Electron app.getPath('userData'))
  2. $XDG_CONFIG_HOME/rein/server-config.json
  3. ~/.config/rein/server-config.json

Configuration Schema

{
  "host": "0.0.0.0",
  "frontendPort": 3000,
  "address": "rein.local",
  "inputThrottleMs": 8,
  "sensitivity": 1.0,
  "invertScroll": false,
  "verboseLogs": true,
  "framerate": 60,
  "streamQuality": "performance",
  "uploadDir": "/home/user/Downloads/ReinShared",
  "audioSource": "",
  "version": "0.1.0"
}

Fields Description

host

  • Type: string
  • Default: "0.0.0.0"
  • Description: Bind address for the HTTP server. "0.0.0.0" listens across all network interfaces (required for LAN access). Set to "127.0.0.1" to restrict to localhost.

frontendPort

  • Type: integer
  • Default: 3000
  • Description: The TCP port for the HTTP server and WebRTC signaling. Changing this via the Settings tab saves to config; requires server restart.

address

  • Type: string
  • Default: ""
  • Description: Optional manual override for the host LAN IP or mDNS hostname (e.g. "rein.local") encoded into the QR code. If empty, Rein auto-detects the host's LAN IP via UDP routing.

inputThrottleMs

  • Type: integer
  • Default: 8
  • Description: Minimum time in milliseconds between high-frequency motion packets (move, scroll, and gamepad-axis). 8ms corresponds to ~125 Hz.

sensitivity

  • Type: float
  • Default: 1.0
  • Range: 0.1 – 10.0
  • Description: Cursor speed multiplier applied to relative trackpad motion in the server-side acceleration algorithm. Applied immediately at runtime without restart.

invertScroll

  • Type: boolean
  • Default: false
  • Description: When false (natural scrolling), swiping up scrolls content up. When true (traditional scrolling), swiping up scrolls content down. Applied immediately at runtime.

streamQuality

  • Type: "performance" | "intermediate" | "quality"
  • Default: "performance"
  • Description: GStreamer x264 video encoding preset:
    • performance: tune=zerolatency, speed-preset=ultrafast, bitrate=2000 (lowest latency, lowest battery usage)
    • intermediate: tune=zerolatency, speed-preset=superfast, bitrate=4000, cabac=false, vbv-buf-capacity=600
    • quality: tune=zerolatency, speed-preset=veryfast, bitrate=8000, cabac=false, vbv-buf-capacity=500 (highest clarity)

framerate

  • Type: integer | null
  • Default: 60
  • Description: Target video framerate in FPS. When set to null or omitted, GStreamer omits videorate and passes frames at the display's native refresh rate.

uploadDir

  • Type: string
  • Default: ~/Downloads/ReinShared
  • Description: Absolute host filesystem directory where files uploaded from viewer devices are stored and where the directory browser starts. Created automatically if it does not exist.

audioSource

  • Type: string
  • Default: "" (auto-detected)
  • Description: Custom GStreamer pipeline source blocks for audio. If empty, Rein auto-detects wasapisrc loopback=true on Windows, osxaudiosrc on macOS, or the default sink monitor via pactl get-default-sink on Linux.

verboseLogs

  • Type: boolean
  • Default: true
  • Description: Enables verbose server console and SSE log streaming.

Runtime vs. Restart Behavior

Setting Applied Immediately at Runtime Auto-Restarts Server Engine Requires Full App Restart
sensitivity ✅ (via webrtcManager.updateConfig()) ❌ ❌
invertScroll ✅ (via webrtcManager.updateConfig()) ❌ ❌
uploadDir ✅ (for next upload/browse) ❌ ❌
streamQuality ❌ ✅ (auto-invokes restartServer()) ❌
framerate ❌ ✅ (auto-invokes restartServer()) ❌
address ✅ (for next IP fetch / QR render) ❌ ❌
frontendPort ❌ ❌ ✅
host ❌ ❌ ✅

Client-Side Settings (localStorage)

These preferences are stored on the viewer device (phone, tablet, or browser) and survive page reloads:

Key Type Default Description
rein_auth_token string "" Cached authentication token extracted from QR scan URL
rein_sensitivity string (float) "1.0" Client trackpad sensitivity
rein_invert "true" | "false" "false" Scroll inversion
rein_theme string "dracula" Active DaisyUI theme
rein_mirror_paused "true" | "false" "false" Pauses the screen mirror video stream on the trackpad
rein_mouse_mode "true" | "false" "false" Enables touchscreen absolute click mode instead of relative trackpad mode
rein_audio_muted "true" | "false" "false" Mutes incoming desktop audio playback
rein_gamepad_layout string (JSON) — Custom positions, scaling, and opacity for virtual gamepad thumbsticks and buttons

Clone this wiki locally