CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

rustdesk/rustdesk

Scanned commit c6a358afbe dated 2026-09-22 — last upstream commit. Generated by codevetter 1.12.0 on 2026-09-22.

github.com/rustdesk/rustdesk ↗ · 856 files · 12.2 MB

Build • Docker • Structure • Screenshots [ Українська ] | [ česky ] | [ 中文 ] | [ Magyar ] | [ Español ] | [ فارسی ] | [ Français ] | [ Deutsch ] | [ Polski ] | [ Indonesian ] | [ Suomi ] | [ മലയാളം ] | [ 日本語 ] | [ Nederlands ] | [ Italiano ] | [ Русский ] | [

Deep analysis by swe-2 via the devin CLI on 2026-09-22 (runtime not recorded) — every claim below links to its cited source files.

Overview

RustDesk is an open-source remote desktop client (v1.5.0) written in Rust with a Flutter UI, covering Windows, macOS, Linux, Android, and iOS. A single binary multiplexes roles via CLI flags: `--server` runs the controlled-side host (screen capture, input injection, clipboard, audio, file transfer), `--cm` runs the connection-manager approval UI, and bare launch runs the Flutter main window; outgoing connections punch via UDP/TCP/WebRTC through a rendezvous server (hbbs) with relay (hbbr) fallback. The wire protocol is protobuf over `hbb_common`'s `Stream`, secured by NaCl sign/box_ key exchange, and the shared protocol crate `libs/hbb_common` is a git submodule also used by the server project.

System map

One Cargo package (`rustdesk`, lib name `librustdesk`, crate-type cdylib+staticlib+rlib) produces the main `rustdesk` binary plus helper bins `service` (macOS) and `naming`, while `libs/portable` builds a self-extracting portable packer. `src/` holds the cross-platform core; `src/platform/` and `src/server/` hold OS- and host-side code; `flutter/` is the current UI (legacy Sciter UI in `src/ui/` is deprecated); `libs/` is a Cargo workspace of vendored crates. `libs/hbb_common` is a git submodule shared with rustdesk-server — it is empty in this clone. CI is GitHub Actions driven by `flutter-build.yml` (reusable) and `flutter-ci.yml` (PR gate).

All 13 system map claims →

Feature catalog

User-facing features map to ConnType variants (default remote desktop, file transfer, view camera, port forward/RDP, terminal) chosen per session, plus host-side services (video, audio, clipboard, input, printer, terminal). Administrative surface is a large CLI (install/service/config/password/deploy) plus TCP/IPC control channels. Monetized/enterprise features hang off the optional api-server (hbbs_http: account, strategy sync, address book, audit upload) and the `--deploy`/`--assign` device-registration commands.

All 15 feature catalog claims →

Data flow

All remote traffic is protobuf `Message`/`RendezvousMessage` frames over a `Stream` abstraction (TCP, KCP/UDP, WebSocket, WebRTC datachannel) provided by hbb_common. Controlled side: rendezvous registration over UDP to hbbs, then per-connection streams multiplexed to named services via `ConnInner` send channels. Controlling side: Session/LoginConfigHandler state owned per session, decoded frames pushed to Flutter via StreamSink events or texture handles. Config is TOML files (Config/Config2/LocalConfig/PeerConfig) synchronized between the root service process and user process over IPC.

Behavior traces

Three flows verified end-to-end: (1) cold start → host registration, (2) outgoing remote-desktop session, (3) incoming controlled connection. A fourth — config sync between the privileged service and user process — is the persistence backbone. Function names below are the real call chain.

Testing signals

Rust tests are unit-style `#[cfg(test)]`/`#[test]` modules embedded across src/ and a dedicated directory for video_qos; Flutter tests use flutter_test in flutter/test. CI exercises builds heavily (flutter-build.yml matrix) and runs a small set of named cargo test filters on Linux plus one flutter test file; there is no end-to-end session/integration test harness — network paths are exercised only in production.

Risk map

The riskiest surface is the unauthenticated pre-login path (deliberately bounded by slot pools and message caps), the IPC bridge between privileged service and user processes (heavily hardened with uid/executable checks), and updater/portable paths that write executables and delete files. Heavy use of forked/patched crypto-adjacent deps (webrtc, tungstenite, kcp) and `panic=abort` release profile amplify small defects. The empty hbb_common submodule means the actual wire crypto/proto code cannot be audited in this clone.

Extension points

Extension happens at five seams: (1) the Service registry — implement `Service`/`Subscriber` and register in `server::new()`; (2) ConnType — add a variant through protos + session_add dispatch + Flutter WindowType; (3) option keys — append to libs/base/src/config/keys.rs and src/lang template; (4) CLI flags — extend the args[0] chain in core_main; (5) Flutter FFI — new pub fns in flutter_ffi.rs + flutter_rust_bridge codegen. Platform code goes in src/platform/*, not shared paths.

Contributor handoff

Read AGENTS.md first — it is the authoritative style/scope contract (no unwrap, no nested tokio runtimes, minimal diffs, additive-only changes, import/comment/localization rules). Build requires the hbb_common submodule and system deps (vcpkg/pkg-config for vpx/opus/aom); the pinned Rust 1.75 toolchain and Flutter 3.24.5 matter. Safe edit boundaries: new code in feature modules or src/platform/*; dangerous: shared protocol/session files and anything touching pre-auth limits.

Languages

LanguageFilesShare of source
Rust28774%
Markdown81docs/config
C226%
C++205%
YAML20docs/config
Shell185%
Python154%
Kotlin133%

Start reading here

Probable source entrypoint: Cargo.toml — inferred from the directory tree and manifest, not the upstream docs.

Source roots

src/ (202 files)

Repository structure

Top-level pathFiles
flutter/262
src/202
libs/154
res/123
docs/63
.github/18
fastlane/14
flatpak/2

Docs found: AGENTS.mdCLAUDE.mdREADME.mddocs/CODE_OF_CONDUCT-DE.mddocs/CODE_OF_CONDUCT-FR.mddocs/CODE_OF_CONDUCT-JP.mddocs/CODE_OF_CONDUCT-KR.mddocs/CODE_OF_CONDUCT-NL.mddocs/CODE_OF_CONDUCT-NO.mddocs/CODE_OF_CONDUCT-PL.md

Package

Cargo.toml — RustDesk v1.5.0, 80 declared dependencies.

android-wakelockandroid_loggerarboardasync-processasync-traitbasebytemuckbytescccfg-ifchronocidr-utils

CI & config entrypoints

Structural health signals

Average score 6/10 across 96 analyzed source files; 51 hotspots surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history