OpenNOW
Architecture

Architecture Overview

How the OpenNOW Electron client, renderer WebRTC path, and native streamer fit together

OpenNOW is an Electron app with three always-present Electron layers and an optional experimental Rust native streamer child process on supported desktop platforms. Electron owns authentication, session lifecycle, and signaling in both streaming modes.

Source layout

opennow-stable/src/
├── main/                    Electron main process
│   ├── platforms/gfn/       OAuth, service URLs, catalog, CloudMatch, NVST transport
│   ├── ipc/                 focused account/catalog, session, and media IPC handlers
│   ├── session/             Cloud G-Sync preference, session conflict, selection/lifecycle helpers
│   ├── signaling/           signaling IPC coordinator and native-streamer bridge
│   ├── media/               screenshots, recordings, thumbnails, media file helpers
│   ├── services/            PrintedWaste queue metadata, region ping, request timeout/cache services
│   ├── nativeStreamer/      Rust child-process lifecycle plus input/surface helpers
│   ├── mediaPaths.ts        trusted OpenNOW media URL protocol
│   ├── discordRpc.ts        Discord Rich Presence lifecycle
│   ├── appBuildInfo.ts      app version, embedded build number, and commit metadata
│   ├── updater.ts           update checks and electron-updater integration
│   ├── settings.ts          settings defaults, migration, compatibility normalization
│   └── index.ts             app bootstrap, Chromium/WebRTC flags, windows, protocol/services wiring
├── preload/                 typed contextBridge surface
├── renderer/src/
│   ├── components/          app pages, StreamView, SettingsPage, queue server modal, controller library
│   ├── platforms/gfn/       renderer WebRTC client, SDP/NVST helpers, input protocol, microphone
│   ├── hooks/               reusable runtime hooks, including queue ad playback/reporting
│   └── utils/               diagnostics and UI helpers
└── shared/                  IPC names, Settings, native streamer protocol/types, GFN models

native/opennow-streamer/      Rust child process with stub and modular GStreamer backend

Process responsibilities

LayerResponsibilities
Main processOAuth/PKCE, provider discovery, CloudMatch create/poll/claim/stop, queue/server selection state, WebSocket signaling, settings, build metadata/updater, Discord Rich Presence, media storage, native streamer process lifecycle
PreloadNarrow window.openNow API over IPC; isolates renderer from Node.js APIs
RendererReact app, login/library/settings, queue and launch UI, controller mode, shortcuts, renderer WebRTC playback, stats overlay, screenshots/recordings
Native streamer (optional, experimental)Rust JSON-lines protocol v3 child process in the app; GStreamer webrtcbin offer/answer, local ICE, input data channels, platform video decode/render, stall/transition/stats diagnostics, and Windows native shortcut/input capture

Streaming data flow

FlowMain processRendererNative streamer
AuthOpens browser/callback server, exchanges and refreshes tokensStarts login/logout, displays auth stateNot involved
LaunchCreates session, polls queue, handles server selector, claims session, normalizes CloudMatch errorsShows launch/queue state, including membership-upgrade errors from GFN playability responsesReceives session context only in native mode
SignalingConnects NVST WebSocket, receives offer/ICE, sends answers/candidatesWeb mode: creates answer and local ICENative mode: receives offer command, returns answer and local ICE events
StreamingChooses web vs experimental native mode on supported desktop platforms; normalizes native mode back to web on unsupported platforms and falls back when native is unavailableWeb mode: Chromium RTCPeerConnection, <video>/<audio>, input channels, statsNative mode: GStreamer webrtcbin, platform decode/render, input readiness, native stats/events
InputProvides IPC helpers and forwards native commandsCaptures keyboard/mouse/gamepad/clipboard; web mode sends over data channelsNative mode sends encoded input after input-ready; Windows also has native OS-level input capture and shortcut reporting
MediaWrites screenshots/recordings and thumbnailsRenderer capture via canvas/MediaRecorderNative external renderer has separate capture limitations
SettingsLoads, migrates, normalizes, persists settings.jsonRenders settings UIReceives selected native settings as environment/session context

WebRTC renderer path

The default streamClientMode is web. The renderer owns RTCPeerConnection, SDP munging, NVST SDP generation, audio/video element playback, microphone capture, and data channels. Chromium acceleration flags are configured by the main process before app startup through videoAcceleration.ts: Windows D3D11/Media Foundation, Linux x64 VA-API plus Linux GL/zero-copy/NVIDIA VA-API flags, Linux ARM V4L2/direct decoder, macOS VideoToolbox, MP4 MediaRecorder support, dav1d AV1 fallback, disabled mDNS ICE candidates, ignored GPU blocklists, and unthrottled renderer behavior. The Settings codec diagnostics use Chromium capability reports and show a Linux VA-API setup hint when GPU decode/encode or H.265 support is still missing.

Native streamer path

When experimental native mode is selected on a supported desktop platform, the main process starts opennow-streamer, performs a protocol hello, sends start/offer/ICE/input/surface/bitrate/update-shortcuts/stopcommands, and receivesready/answerresponses plus async status, local ICE, input readiness, shortcut, video liveness, stats, and error events. The shipped media backend is Rust + GStreamerwebrtcbin`; unsupported platforms, unsupported builds, or unavailable backends report fallback details so the app can return to the web streamer path.

Key source files

FilePurpose
opennow-stable/src/main/index.tsApp bootstrap, windows, protocol/services wiring
opennow-stable/src/main/videoAcceleration.tsChromium/WebRTC acceleration feature and switch selection
opennow-stable/src/main/ipc/accountCatalogHandlers.tsAuth/account/catalog/cache/community IPC
opennow-stable/src/main/ipc/sessionHandlers.tsCreate/poll/claim/stop/session-ad IPC
opennow-stable/src/main/ipc/mediaHandlers.tsScreenshot, recording, and media gallery IPC
opennow-stable/src/main/signaling/signalingCoordinator.tsSignaling IPC coordination and native-streamer bridge
opennow-stable/src/main/session/*.tsCloud G-Sync preference, active-session conflict handling, session selection/lifecycle helpers
opennow-stable/src/main/media/*.tsScreenshot/recording persistence, media file validation, thumbnail helpers
opennow-stable/src/main/mediaPaths.tsTrusted OpenNOW media path resolution and playback URL protocol
opennow-stable/src/main/services/*.tsPrintedWaste queue metadata, region ping, request timeout/cache services
opennow-stable/src/main/platforms/gfn/auth.tsOAuth + PKCE, token refresh, provider discovery
opennow-stable/src/main/platforms/gfn/cloudmatch.tsSession creation, queue polling, claim, stop
opennow-stable/src/main/platforms/gfn/signaling.tsNVST WebSocket signaling client
opennow-stable/src/main/nativeStreamer/manager.tsNative executable lookup, environment, protocol lifecycle, fallback
opennow-stable/src/main/nativeStreamer/input.ts, surface.tsNative input and render-surface normalization
opennow-stable/src/main/discordRpc.tsDiscord Rich Presence updates
opennow-stable/src/main/appBuildInfo.tsApp version, embedded build number, and commit metadata
opennow-stable/src/main/updater.tsAutomatic update checks
opennow-stable/src/main/settings.tsSettings defaults and compatibility normalization
opennow-stable/src/renderer/src/platforms/gfn/webrtcClient.tsRenderer WebRTC peer connection, data channels, stats
opennow-stable/src/renderer/src/platforms/gfn/sdp.tsSDP and NVST SDP helpers
opennow-stable/src/renderer/src/lib/codecDiagnostics.tsBrowser codec capability tests and Linux hardware-acceleration hint logic
opennow-stable/src/renderer/src/hooks/useQueueAdRuntime.tsQueue ad playback/reporting watchdog runtime
opennow-stable/src/renderer/src/components/QueueServerSelectModal.tsxQueue server selection UI
opennow-stable/src/renderer/src/components/controllerMode/ControllerLibraryPage.tsxController-first library page
opennow-stable/src/renderer/src/components/controllerMode/controllerLibrary/ControllerLibraryLayout.tsxController library layout and navigation
opennow-stable/src/shared/gfn/Shared settings, session, stream, native, and API types
opennow-stable/src/shared/nativeStreamer.tsTypeScript protocol v3 definitions
native/opennow-streamer/src/protocol.rsRust protocol/session structs
native/opennow-streamer/src/backend.rsBackend selection and stub fallback
native/opennow-streamer/src/gstreamer_backend.rsGStreamer backend orchestration
native/opennow-streamer/src/gstreamer_pipeline.rsGStreamer webrtcbin pipeline construction and negotiation
native/opennow-streamer/src/gstreamer_input.rs, gstreamer_liveness.rs, gstreamer_platform.rs, gstreamer_transitions.rs, gstreamer_config.rsInput channels, liveness diagnostics, platform paths, transition telemetry, backend configuration

On this page

On this page