molcajete GitHub

Open source · Apache License 2.0

Remote desktops in a browser tab, drawn on the GPU.

molcajete is a clientless gateway for RDP, VNC and SSH, written in Rust. Its browser client is WebAssembly: it parses, decodes and renders in a Web Worker with WebGL2, so the page stays responsive while the screen changes.

  • RDP
  • VNC
  • SSH + SFTP
  • Telnet and Kubernetes through stock guacd
One click from the connection list to an Ubuntu desktop over RDP. The statistics overlay shows the renderer on a worker thread, and switching the screen to H.264 video. Reloading the page returns to the same desktop.
3–6×less main-thread CPU time than the reference client when replaying the same recorded updates
~25%smaller on the wire: images, video and audio travel as raw bytes, not base64
AV1 · H.265 · H.264for busy areas or the whole screen, decoded by WebCodecs
120 sa dropped RDP or VNC session is held by default, so a reload reattaches (300 s for SSH)

Why a new client

The page's main thread stays free.

The reference Guacamole client draws each layer on a 2D canvas on the main thread and reads pixels back for raster operations. molcajete's client runs the WebSocket tunnel, the parser, image and video decoding and the WebGL2 renderer inside a dedicated Web Worker, on an OffscreenCanvas.

  • Whole frames at once. Instructions are parsed in WebAssembly and executed together at each sync.
  • No pixel readback. Copies, fills, channel masks, raster operations, clipping and paths run in WebGL2 shaders.
  • Hardware video. molcajeted sends busy areas as AV1, H.265 or H.264, and can pass RDP's own H.264 (EGFX AVC420 / AVC444) through without encoding it again.
  • Context recovery. When the browser takes the GPU context away, the client restores it and asks for a full frame. The session goes on.
An RDP session with the statistics overlay: renderer WebGL2 (worker thread), video h264, 25 frames per second, present latency 0.4 ms.
The statistics overlay of a live session.

Terminals

SSH that reads Korean, Japanese and Chinese.

The terminal bundles DejaVu Sans Mono and NanumGothicCoding, so CJK text lines up without anything installed on the server. Files move over SFTP: drag them onto the session to upload.

  • Links open with Ctrl or Cmd and a click.
  • On touch screens: drag to scroll, hold to select, pinch to change the text size, and a key bar with Esc, Tab, Ctrl and the arrows.
  • Added to the Home Screen on iPadOS, it runs as a standalone app, so shortcuts reach the remote shell.

Recordings

Play a session back, and jump to any moment.

Connections can record every session, or users can start a recording from the session menu. Recordings play in the browser with seeking and up to 8× speed, in a format that guacenc reads or in molcajete's own, which is smaller and seeks faster.

  • Share a live session with a watch-only or interactive link.
  • Administrators see who is connected and can watch or end a session.
  • Connection history and an audit log with field-level changes, secrets redacted, and CSV export.

Features

A gateway for a team, not only a viewer.

Sessions that survive a reload

molcajeted holds a dropped tunnel for a grace period and pauses the remote display meanwhile. The same browser reattaches after a reload or a short outage.

File transfer

SFTP in SSH and a shared drive in RDP. Downloads stream to disk in Chrome and Edge. Each direction can be blocked, and a size limit set.

Sign-in your organization already has

OpenID Connect with role and group sync, Active Directory and OpenLDAP with nested groups, and authenticating reverse proxies with trusted headers or signed JWTs.

Second factors and passkeys

TOTP per user or required by a group, WebAuthn passkeys and security keys, also as the only step. Failed sign-ins are throttled, across replicas when asked to.

Roles, groups and folders

User, connection manager and administrator roles, grants that follow the folder tree, and stored credentials that are write-only and encrypted with AES-256-GCM.

Jump hosts

Reach RDP, VNC and SSH hosts through up to four SSH bastions, with credentials and host keys per hop.

Embedding

An API token makes a one-time session link for an iframe, or mount the session component on your own origin with the JavaScript client.

Observability

JSON logs, Prometheus metrics from the daemon, the gateway and the browser client, continuous CPU profiles, and a Grafana dashboard.

Works with stock Guacamole

Every boundary speaks the Guacamole protocol. The gateway can route some connections to stock guacd and others to molcajeted.

Administration

What the web UI looks like.

The connection list: an Ubuntu desktop over RDP, an X11 desktop over VNC, and a build server shell over SSH.

Architecture

Four parts, each replaceable.

molcajete reimplements the pieces of an Apache Guacamole deployment in Rust. Because each one speaks the same protocol as the piece it replaces, you can adopt them one at a time.

Browsermolcajete-client
wasm · Worker · WebGL2
molcajete-gatewaytunnel · web UI · sign-in
PostgreSQL, MySQL or SQLite
molcajetedor stock guacd
Your hostsdesktops and servers
ComponentReplacesWhat it does
molcajete-protocolthe protocol code in libguac and guacamole-commonStreaming parser and encoder, typed instructions, binary records, video framing
molcajete-clientguacamole-common-jsWorker and WebGL2 renderer, WebCodecs video, input and IME, audio, recording playback
molcajete-gatewaythe Guacamole web applicationWebSocket tunnel, React UI, database, sign-in, recordings, history, audit log, API tokens
molcajetedguacd and its protocol pluginsVNC, SSH with SFTP, RDP with audio and a shared drive, jump hosts, session resume, video mode

Quick start

Running on your machine in a few commands.

You need Rust 1.94 or later with the wasm32-unknown-unknown target, wasm-bindgen-cli 0.2.130, bun and Docker. The compose file starts test targets: an X11 desktop over VNC, an OpenSSH server and an xrdp desktop.

Then open http://127.0.0.1:8080 and sign in as admin / change-me.

git clone https://github.com/clroot/molcajete && cd molcajete
rustup target add wasm32-unknown-unknown
cargo install wasm-bindgen-cli --version 0.2.130 --locked

# Test targets: guacd, X11/VNC, OpenSSH and xrdp
docker compose -f docker/compose.yml up -d --build

# The wasm client and the web UI, then the gateway
scripts/build-web.sh
cp gateway.example.toml gateway.toml
cargo run -p molcajete-gateway -- --config gateway.toml

# In a second terminal: the Rust daemon
cargo run -p molcajete-daemon -- -l 4823