Expand description
§solari-browser
Rust binding for the Solari Browser platform — the control plane:
acquire and release pooled stealth Chromium sessions, manage stored browser
profiles, pull session replays, and inspect managed-proxy egress. It speaks
the same wire contract as the reference @solarisdk/browser TypeScript
package (sdk/src/index.ts).
use solari_browser::{Client, ClientOptions, CreateSessionOptions, ProxySpec};
let client = Client::new(ClientOptions::default_region("slr_live_…"))?;
let session = client
.sessions()
.create(
CreateSessionOptions::new()
.stealth(true)
.proxy(ProxySpec::country("us")),
)
.await?;
println!("ws {}", session.ws_endpoint); // Playwright wire protocol
println!("cdp {}", session.cdp_endpoint); // raw CDP — use this from Rust
client.sessions().release(&session.id).await?;§Scope
This crate is the control plane plus browser attachment. Playwright has
no Rust binding, so there is no port of the TypeScript BrowserSession
Playwright object model; instead, with the connect feature enabled you get
two levels of attachment, both driving the session over raw CDP via
chromiumoxide:
- [
connect] — attach to a session you already created; and - [
Client::launch] — a thin one-call convenience (create, connect, seed an attached profile’s cookies, health-probe, retry, and release on close) that hands back the same [chromiumoxide::Browser] to drive.
Enable it with:
solari-browser = { version = "0.2", features = ["connect"] }§Endpoints vs. the TypeScript SDK
The TS SDK routes wsEndpoint / cdpEndpoint through a Node-side loopback
LocalProxy. This crate has no such indirection: Session::ws_endpoint
and Session::cdp_endpoint are the upstream gateway endpoints.
Structs§
- ApiError
Body - Shape the API’s error bodies may take. Every field is optional — an error body is best-effort and may not be JSON at all.
- Client
- Talks the Solari Browser control-plane REST API.
- Client
Options - Options for constructing a
Client. - Cookie
- One cookie in a
StorageState. - Create
Session Options - Options accepted by
POST /sessions. - Editor
State - Result of
ProfileEditor::status. - List
Sessions Options - Filters and paging for
Sessions::list. The default lists the first page. - Local
Storage Entry - One
localStoragekey/value pair. - Profile
- A stored browser profile (cookies + localStorage).
- Profile
Editor - A handle on an open profile editor. Send the person to
url; it works untilexpires_at. There is no save without closing:save_and_closestores the profile and ends the editor,exitends it without saving. - Profile
Save Result - Result of
POST /profiles/:id/save. - Profiles
- The
profilesnamespace. Obtain viaClient::profiles. - Proxy
- The
proxynamespace. Obtain viaClient::proxy. - Proxy
Countries GET /proxy/countries— supported egress countries, plus whether the gateway actually has residential credentials configured.- Proxy
Request - Managed proxy egress request.
- Replay
Url - Presigned URL for a session’s replay.
- Resolved
Proxy Config - Coarse confirmation of the proxy the gateway resolved for a session.
- Session
- A live browser session.
- Session
List - One page of
Sessions::list. - Session
Summary - One row of
Sessions::list. It never carries the websocket endpoints (they are bearer capabilities): useSessions::get. - Session
View GET /sessions/:id. Fields the gateway adds later land inSessionView::extra.- Sessions
- The
sessionsnamespace. Obtain viaClient::sessions. - Storage
Origin - One origin’s
localStoragein aStorageState. - Storage
State - A browser profile’s persisted state — Playwright’s
storageStateshape. Unknown keys round-trip throughStorageState::extra.
Enums§
- Editor
Status - State of a profile editor.
- Proxy
Spec - What to send as the
proxyfield ofPOST /sessions. - Proxy
Tier - Managed proxy tier.
- Same
Site - Cookie
sameSitepolicy, as Playwright spells it. - Solari
Error - Every error raised by this crate.
- Solari
Error Code - Machine-readable error codes the API returns in a
{ "code": … }body. - Solari
Region - Supported Solari regions. More coming soon.