Using a Proxy
Give a persona its own proxy, with a timezone and locale that follow where the proxy exits.
A persona can carry its own proxy. With a proxy, the persona's timezone and locale follow where the proxy exits, unless you state them.
Set the proxy
Add "proxy" to the persona file, next to its device facts. For example, an HTTP or a SOCKS5 proxy with
credentials:
"proxy": "http://user:password@host:port""proxy": "socks5://user:password@host:port"Then make the persona from the file, or give an existing persona its settings anew:
bauta persona new shop --from shop.json # a new persona
bauta persona set shop --from shop.json # an existing one: new settings, its profile keptA browser that is running the persona keeps the old settings until it closes, so a persona never changes under a
page. A persona file to start from is personas/win-intel.json in the
bauta-browser repository; see also the
persona file reference.
From the packages, pass proxy:
browser = launch(proxy="http://user:pass@host:port")const browser = await launch({ proxy: "http://user:pass@host:port" });In Docker, a persona file's settings are the same as outside it. Personas that share a browser still each have their own proxy, timezone and the rest of their persona.
Escape special characters
Any :, @ or / in the user name or password is %-escaped:
| character | escaped |
|---|---|
: | %3A |
@ | %40 |
/ | %2F |
For the password p@ss:word:
"proxy": "http://user:p%40ss%3Aword@host:port"When the proxy refuses the credentials
If the proxy turns the credentials away, requests fail at once, and bauta serve says so.
Timezone and locale follow the proxy
With a proxy, and neither "timezone" nor "locale" stated, they follow where the proxy exits. bauta serve asks
an IP echo through the proxy and places the address with a database that bauta geo update keeps:
bauta geo update| variable | what it does |
|---|---|
BAUTA_IP_ECHO | The IP echo that bauta serve asks through the proxy. https://api.ipify.org by default. |
To set them yourself, state both:
"timezone": "America/New_York",
"locale": "en-US"From the packages, pass timezone and locale; with a proxy, they follow where the proxy exits unless you give
both. A client that sets its own locale or timezone is answered as if it had, but the page keeps the persona's.
IP geolocation by DB-IP, under CC BY 4.0.
When no place is found
If no place can be found for the proxy's exit, and none was found before, the persona's browser does not start,
rather than show this machine's timezone behind a foreign address. A persona that states both "timezone" and
"locale" does not follow the proxy's exit.