All posts
Concepts1 min read

A persona per context, not per browser

How bauta's gateway puts several personas in one browser while each keeps its own identity, proxy and storage.

Most setups give every identity a browser of its own: a process tree, a window and a share of memory per session. bauta's gateway gives every persona an endpoint of its own instead, and lets personas share browsers.

One endpoint per persona

bauta serve puts each persona behind a CDP endpoint of its own. A script keeps its code and changes only how it connects:

browser = playwright.chromium.connect_over_cdp("http://127.0.0.1:9222/persona/shop")

What personas share, and what they don't

Personas share browsers, up to --per-browser (8) to one, among personas whose fonts, locale and screen scale match. Each still has its own User-Agent, Client Hints, timezone, proxy and the rest of its persona. A client sees only its own persona's pages, as if the browser were its own, and the endpoint is the same whichever browser holds it.

Storage

A persona keeps its own profile, so cookies and storage are there on the next connection. While it is away, its profile is written out and unloaded. A persona with "ephemeral": true keeps nothing between sessions.

Failures stay contained

A shared browser that crashes takes its personas with it, and no others. Each starts again on its next connection.

Why it matters

Fewer browsers for the same sessions take less memory: on one machine, eight personas in one browser took 28 % less memory than stock Playwright with a browser in a window per session (the measurement).

The gateway covers the flags; --per-browser 1 gives every persona a browser of its own.