The Proxy-Authorization header for a Basic proxy is the word Basic, a space, and the base64 encoding of username:password. For the username user and password pass that is Proxy-Authorization: Basic dXNlcjpwYXNz. Base64 is an encoding, not encryption: echo dXNlcjpwYXNz | base64 -d prints user:pass. On a plain HTTP proxy that header crosses the network as readable text, every time.

We send this header on behalf of every profile in Mosaic that has a proxy with a password, so we have had reason to look at it closely.

How the header is built

The rules are in RFC 7617, which defines the Basic scheme, and RFC 7235 (now folded into RFC 9110), which defines the proxy side of the exchange.

  1. The client asks the proxy for something without credentials.
  2. The proxy answers 407 Proxy Authentication Required with a Proxy-Authenticate: Basic realm="..." header naming the scheme it accepts.
  3. The client joins the username and password with one colon, encodes the bytes as base64, and repeats the request with Proxy-Authorization: Basic <that string>.

A client that already knows the proxy wants Basic can skip the first round trip and send the header on the first request. Mosaic does that.

To build one by hand:

printf '%s' 'user:pass' | base64
dXNlcjpwYXNz

Use printf or echo -n, not plain echo. A trailing newline gets encoded too, the password becomes pass\n, and the proxy answers 407 to credentials that look right.

Two details from the RFC catch people out. The username cannot contain a colon, because the decoded string is split at the first one; anything after it is the password, and a password may contain colons. And the RFC lets a server say charset="UTF-8" in its challenge to state the encoding it expects. Without it, a password with non-ASCII characters is encoded however the client chooses. Mosaic encodes UTF-8.

Paste one proxy line. Every profile gets its own IPIn Mosaic: A new IP for every profile. One proxy account, a separate IP for every profile. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.

How it works: A new IP for every profile

Why base64 is in there at all

Base64 exists so that arbitrary bytes fit inside a header line. It was never meant to hide anything, and it does not. Any decoder reverses it, there is no key, and the same credentials always produce the same string, so the header is as good as the password to whoever copies it.

With a proxy seller, the string carries more than a password. Sellers put targeting and sessions in the username: something like customer-acme-cc-de-sessid-k3j9q2 for a German IP on one sticky session. Encoded with a password, that is:

Proxy-Authorization: Basic Y3VzdG9tZXItYWNtZS1jYy1kZS1zZXNzaWQtazNqOXEyOlRyMHViNGRvcg==

Decode it and you get the account, the country, the session id and the password, which is enough to browse on that account's traffic from that IP.

Who can read it

The header goes to the proxy and stops there. A proxy that follows the spec consumes it and does not forward it, so the site at the far end never sees your proxy credentials.

What can read it is the hop between your computer and the proxy. With a plain HTTP proxy that hop is plain TCP. For an https:// site, the header sits in the CONNECT request, before any TLS starts:

CONNECT example.com:443 HTTP/1.1
Host: example.com:443
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 ...
Proxy-Authorization: Basic dXNlcjpwYXNz

For an http:// site it is worse, because the whole request goes to the proxy in the clear, path, cookies and all, with the credential attached.

So the café Wi-Fi, an office network that inspects traffic, or anyone else on the path can collect the password from the first request. Repeating it on every request does not add exposure on top of that, since the first one already gave it away. SOCKS5 has the same problem in a different shape: its username and password sub-negotiation, RFC 1929, sends both as plain bytes.

There is one fix on the wire, and it is TLS to the proxy itself. With an HTTPS proxy the client opens TLS to the gateway first, and the CONNECT line and its header travel inside it (what an HTTPS proxy adds over an HTTP one covers what that hides and what it does not). The other options avoid the password altogether: a seller's IP allowlist, where the gateway accepts your address instead of credentials, or a VPN to a network you trust before the proxy.

Where Mosaic puts the header

Chrome's --proxy-server switch has no place for a username or a password, and the login prompt Chrome shows for a 407 waits for a person to type into it. So a profile in Mosaic with an authenticated proxy does not log in to the gateway itself. Mosaic logs in for it, on your computer: the browser hands its traffic to Mosaic on 127.0.0.1, with no credentials at all, and Mosaic adds Proxy-Authorization on the way to the proxy.

That splits the path in two. The browser's half of the path is loopback, so the credential never appears in the browser's own traffic and never leaves the machine on that hop. Any Proxy-Authorization the browser itself sends is treated as hop-by-hop and dropped, never forwarded. The gateway's side is where the header is written, last in the CONNECT request, which is where Chromium's own BuildTunnelRequest puts it, after Host, Proxy-Connection and the browser's own User-Agent. We copied that order from the Chromium source after a recording proxy showed Mosaic writing a different one (our proxy login told the gateway it was a script has the before and after).

What Mosaic cannot do is encrypt a hop the gateway does not encrypt. For a proxy set to http, the header leaves your computer as base64 text, exactly as it would from Chrome. For a proxy set to https, Mosaic opens TLS to the gateway first, with the gateway's hostname as the server name, and writes CONNECT and the header only once that channel is up. A gateway whose certificate does not check out is refused.

So the honest summary is short. Mosaic keeps the password out of the browser and off the loopback hop. Only an HTTPS proxy keeps it off the wire to the gateway. If your seller offers a TLS port, use it. The full list of what to test before trusting an account to an IP is in how to check a proxy before you use it.