# RfbDesk An open-source, native Windows client for macOS Screen Sharing. Turn on Screen Sharing on the Mac, then connect from Windows by IP address or hostname (a Tailscale address works). Nothing gets installed on the Mac, and there are no accounts or relay servers. The goal is to make Windows-to-Mac feel like Mac-to-Mac: low-latency video, audio, keyboard and mouse control, automatic two-way clipboard sync, and virtual displays. ## Protocol macOS Screen Sharing is built on RFB ([RFC 6143](https://www.rfc-editor.org/rfc/rfc6143)) and adds Apple's own extensions: | Layer | Contents | |---|---| | Standard RFB | TCP 5900, framebuffer updates, key and pointer events | | Apple extensions | macOS account authentication (SRP), AES-128 encrypted control channel, virtual displays, clipboard | | Apple media transport | HEVC 4:4:4 video and AAC-ELD audio over SRTP/UDP | RfbDesk is written from protocol facts in the reverse-engineered [Apple VNC High-Performance Extension](https://github.com/renegadelink/iShareScreen/blob/main/docs/apple_vnc_rfc.md) document. It does not copy or translate code from AGPL implementations such as iShareScreen or MacCanvas. ## Stack | Part | Choice | |---|---| | Protocol, session | C# / .NET, no UI dependency | | UI | WinUI 3 | | Video | FFmpeg (LGPL build) decoding, Direct3D 11 rendering | | Audio | FFmpeg AAC-ELD decoding and shared-mode WASAPI playback through NAudio | ## Roadmap | Milestone | Delivers | Status | |---|---|---| | M1 Protocol prototype | Authenticate, encrypted control channel, first frame saved to PNG from a CLI | Done | | M2 Windows viewer | WinUI window, framebuffer rendering, keyboard and mouse | Done | | M3 Media | HEVC video and audio over SRTP/UDP | HEVC video and Mac system audio available | | M4 Native experience | Automatic clipboard sync (text and images), dynamic resolution | Clipboard done | | M5 Release | Portable ZIP on GitHub Releases, then MSIX | | ## Layout | Project | Responsibility | |---|---| | `RfbDesk.Client` | Connects to the Mac and exposes the RFB session, framebuffer, clipboard and media stream. Media packet processing and recovery live in `Media/`. | | `RfbDesk.Viewer` | Owns viewer sessions, input, clipboard synchronization rules, frame selection and diagnostics. Runs on any supported .NET platform. | | `RfbDesk.Windows` | Hosts the WinUI windows. `Video/` decodes HEVC with FFmpeg and `Rendering/` presents frames through Direct3D. Builds `RfbDesk.exe`. | | `RfbDesk.Cli` | Builds `rfbdesk-cli` for connection probes, capture replay and metrics reports. | Production projects are under `src/`. Their tests are under `tests/`. The client tests also exercise the CLI's relay and metrics report. `dotnet test` at the root covers the protocol library, CLI and portable viewer logic on any OS. On Windows, run `scripts/fetch-ffmpeg.ps1`, then `dotnet build src/RfbDesk.Windows` to build the viewer and `dotnet test --project tests/RfbDesk.Windows.Tests` to exercise the native decoder and renderer. See the [contributor instructions](AGENTS.md). ## Connection metrics Connection options are under **Settings** (the gear in the launcher's title bar) and apply to future connections. | Setting | Default | Effect | |---|---|---| | **Mac desktop size** | 1920 × 1080 | 3840 × 2160 (4K) requests a 4K desktop from the Mac. | | **HEVC video** | On | Turn it off to compare the RFB framebuffer on the same Mac. | | **Standard picture colors** | Full color | Full color or 16-bit for framebuffer updates, including after a media fallback. | | **Save connection metrics** | On | Saves one local sample per second while connected. **Open folder** shows where. | When the Mac accepts a media connection, the viewer plays Mac system audio on the default Windows multimedia output. Set its volume in the Windows volume mixer. In the viewer, **Fit to window** shows the whole desktop. **Actual size** displays one video or framebuffer pixel per physical Windows pixel; its scrollbars reach the rest of a larger desktop. Run `rfbdesk-cli metrics` on Windows to summarize retained sessions, or pass an exported metrics directory or session file. See [Connection metrics](docs/connection-metrics.md) for the sample fields and their units. ## License [MIT](LICENSE). Third-party codecs keep their own licenses.