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 a connect() helper. There is no
port of the TypeScript Solari.launch(), which hands back a live Playwright
Browser — Playwright has no Rust binding. To drive a session from Rust,
enable the connect feature and attach to Session::cdp_endpoint with
chromiumoxide:
solari-browser = { path = "sdk/rust", 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. - Local
Storage Entry - One
localStoragekey/value pair. - Profile
- A stored browser profile (cookies + localStorage).
- 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
View GET /sessions/:id. The API proxies the pool’s view through verbatim, so every field is optional and unknown keys 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§
- 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.