Skip to content

Add community Rust client (rust/) - #438

Open
enrell wants to merge 3 commits into
CloakHQ:mainfrom
enrell:feat/rust-client
Open

Add community Rust client (rust/)#438
enrell wants to merge 3 commits into
CloakHQ:mainfrom
enrell:feat/rust-client

Conversation

@enrell

@enrell enrell commented Jul 11, 2026

Copy link
Copy Markdown

Community Rust client

Adds a Rust wrapper under rust/, following the same monorepo conventions as the first-party .NET client (dotnet/, PR #385): self-contained crate + CLI + examples + unit tests, built on playwright-rs.

This is a faithful port of the open-source wrapper surface (not the Chromium binary). Behavior targets parity with Python / JS / .NET for launch flags, download verification, Pro routing, proxy/GeoIP/WebRTC, and humanized input.

Conventions followed

  • Layout: rust/ at the repo root, alongside cloakbrowser/ (Python), js/, and dotnet/. Workspace with cloakbrowser (lib) + cloakbrowser-cli (bin) + examples.
  • Versioning: wrapper version 0.4.10, matching the current monorepo release.
  • Docs: rust/README.md is the client guide (feature matrix, API, env vars, Python→Rust mapping). Root README gets a short Install blurb + Latest bullet; CHANGELOG.md has an [Unreleased] entry.
  • CI: new rust job in .github/workflows/ci.yml runs cargo test -p cloakbrowser --lib (browser-free unit tests).

What's ported

Area Notes
Binary lifecycle Download / cache / auto-update; pinned Ed25519 on SHA256SUMS.sig + SHA-256; version binding (anti-downgrade); zip-slip guard
Launch Stealth args, ignore automation defaults, proxy HTTP/HTTPS + SOCKS5 (inline creds gated by binary version), GeoIP timezone/locale, WebRTC =auto, extensions, license env injection
Pro license_key / CLOAKBROWSER_LICENSE_KEY / ~/.cloakbrowser/license.key; 24h cache; Pro path never silently falls back to free on verification failure
Persistent context launch_persistent_context + viewport auto/Size/NoViewport; Linux Widevine hint seeding
Humanize Explicit HumanPage (Bezier mouse, typing + CDP shift symbols, scroll bursts). Rust cannot monkey-patch Playwright's sealed Page — same design pressure as .NET's decorator layer
CLI install / info / update / clear-cache

Not in this PR (intentionally)

  • Transparent Playwright interface wrapping for every Page method (would be a large generator like the .NET Roslyn source generator). Callers use new_human_page() / HumanPage for humanized actions and page() for the raw Playwright surface.
  • crates.io publish / release automation (happy for maintainers to own packaging).
  • Full actionability matrix / iframe humanize parity with the latest Python frame-routing work.

Tests

cd rust
cargo test -p cloakbrowser --lib   # 34 passed
cargo clippy -p cloakbrowser --lib -- -D warnings

Coverage includes version pins, checksum/manifest parsing, zip-slip, stealth arg composition, proxy SOCKS/HTTP resolution, viewport defaults, Bézier math, keyboard nearby-key map, Widevine no-ops, and license env injection.

Build & try locally

cd rust
cargo run -p cloakbrowser-cli -- install
cargo run -p cloakbrowser-cli -- info --quick
cargo run --example basic -p cloakbrowser
cargo run --example humanize -p cloakbrowser
cargo run --example persistent_context -p cloakbrowser

Happy to adjust naming, CI pins, docs wording, or drop root-README/CHANGELOG touches if you'd rather land those in a follow-up (the .NET PR originally left those to maintainers).

enrell added 3 commits July 11, 2026 14:32
Community-style port of the CloakBrowser wrapper, matching the .NET client
layout under rust/: stealth Chromium download/cache with Ed25519 + SHA-256
verification, Pro license routing, proxy/GeoIP/WebRTC launch args, humanize
via an explicit HumanPage engine (Bezier mouse, typing, scroll), and
persistent contexts with Linux Widevine hint seeding.

Includes cloakbrowser-cli (install/info/update/clear-cache), unit tests, and
examples. Documents usage in rust/README.md and a short Install section in
the root README.
Add a rust CI job (unit tests), document the client under Unreleased in
CHANGELOG, fix outdated rust/README status (humanize is implemented via
HumanPage), and address clippy findings for a clean -D warnings build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant