Add community Rust client (rust/) - #438
Open
enrell wants to merge 3 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Community Rust client
Adds a Rust wrapper under
rust/, following the same monorepo conventions as the first-party.NETclient (dotnet/, PR #385): self-contained crate + CLI + examples + unit tests, built onplaywright-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
rust/at the repo root, alongsidecloakbrowser/(Python),js/, anddotnet/. Workspace withcloakbrowser(lib) +cloakbrowser-cli(bin) + examples.0.4.10, matching the current monorepo release.rust/README.mdis the client guide (feature matrix, API, env vars, Python→Rust mapping). Root README gets a short Install blurb + Latest bullet;CHANGELOG.mdhas an [Unreleased] entry.rustjob in.github/workflows/ci.ymlrunscargo test -p cloakbrowser --lib(browser-free unit tests).What's ported
SHA256SUMS.sig+ SHA-256; version binding (anti-downgrade); zip-slip guard=auto, extensions, license env injectionlicense_key/CLOAKBROWSER_LICENSE_KEY/~/.cloakbrowser/license.key; 24h cache; Pro path never silently falls back to free on verification failurelaunch_persistent_context+ viewport auto/Size/NoViewport; Linux Widevine hint seedingHumanPage(Bezier mouse, typing + CDP shift symbols, scroll bursts). Rust cannot monkey-patch Playwright's sealedPage— same design pressure as .NET's decorator layerinstall/info/update/clear-cacheNot in this PR (intentionally)
Pagemethod (would be a large generator like the .NET Roslyn source generator). Callers usenew_human_page()/HumanPagefor humanized actions andpage()for the raw Playwright surface.Tests
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 cloakbrowserHappy 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).