# How Mosaic assigns proxies by country, measured first

> To assign proxies by country, Mosaic gives each profile a proxy whose checked IP is there, unused first, and trusts the seller's label until a check runs.

Source: https://mosaicbrowser.com/blog/assign-proxies-by-country

## How Mosaic assigns proxies by country, measured first

To assign proxies by country, Mosaic gives each profile a proxy whose checked IP is there, unused first, and trusts the seller's label until a check runs.

![4: Four ways to hand out proxies](https://mosaicbrowser.com/covers/assign-proxies-by-country.webp)

To assign proxies by country, Mosaic's country mode gives each selected profile a saved proxy whose IP is in the country you picked. It goes by the country a check measured where one has run, and by the country the proxy was saved with where none has. It hands out proxies no other profile holds first, and only then starts doubling up. The code is in `src/main/proxy/assign.ts`, and the reasons behind it are what this post is about.

## Why there is one assign function

Pointing profiles at saved proxies used to be written three times: once for the window's IPC, once for REST, once for MCP. They had drifted by the time we looked. REST returned the list of assignments and IPC did not, and MCP returned neither `reused` nor `perProxy`. So only one of three surfaces could tell a caller that forty profiles had just been put on one IP.

Now there is one `assignProxies`, and all three doors call it through one reader that refuses unknown fields by name. It has four modes:

| Mode | What it does |
| --- | --- |
| `one` | every profile on `proxyId`; `null` detaches |
| `roundRobin` | `proxyIds` dealt out in order, wrapping when profiles outnumber proxies |
| `unique` | one proxy per profile that no other profile holds, or a refusal naming the shortfall |
| `country` | proxies that come out in `country`, unused first, then the least loaded |

`unique` refuses on purpose. Owning forty proxies is supposed to mean forty IPs, and a mode that quietly wrapped would hand you thirty-nine and a shared one. `country` is the forgiving one, because a market with two proxies and eight profiles is a real situation, and refusing it would push people back to doing it by hand.

Mosaic is a desktop app

Email yourself the link and open it on your computer.

[How it works: Bulk actions](https://mosaicbrowser.com/features/bulk-actions)

## Assign by country: measured beats declared, one proxy at a time

Every proxy row carries a declared country, the two-letter code it was saved with, usually what the seller said when you bought it. A check replaces that with a measurement: where the proxy's IP actually geolocates. The rule that decides between them is one line:

```
(p.lastCheck?.ok && p.lastCheck.countryCode) || p.countryCode || ''

```

A successful check that found a country wins. Otherwise the declared code stands. The decision is made per proxy, not for the whole list, so a freshly pasted batch with no checks yet still sorts by what the seller said, and each proxy moves to its measured country the moment it is checked. We keep the declared code for that window because a list of twenty new proxies with no flags on them is hard to tell apart exactly when you are trying to.

The window uses the same rule. Under Profiles, select the profiles and open **Assign proxy**. The **By country** list counts proxies by that same measured-or-declared country, so a proxy sold as German that checks out in the Netherlands is listed under the Netherlands. Why that matters for everything drawn on top of the IP, timezone and language included, is on the [IP matching](https://mosaicbrowser.com/features/exit-matching) page.

## Unused first, and what "unused" means

For each profile the mode builds a pool: the proxies in `proxyIds` if you named some, otherwise every saved proxy the profile's project can see, filtered to the country. Then it splits the pool. A proxy is *fresh* if no profile outside this batch holds it.

If any fresh proxy exists, the profile gets the fresh one with the fewest profiles from this batch on it. Only when there is no fresh proxy left at all does it fall back to the whole pool, again least loaded first.

That has a consequence worth knowing. Give country mode six profiles and three unused US proxies, plus a US proxy your other client's profile already uses. You get two profiles on each of the three unused proxies, and the other client's proxy is left alone. Sharing inside the batch you are working on is visible in the answer. Sharing with a profile you were not looking at is the kind that links two accounts nobody meant to connect, which is why [forty profiles should mean forty IPs](https://mosaicbrowser.com/blog/forty-profiles-forty-exits).

## Nothing written until everything is chosen

Every choice is made before any profile is written. If the fifth of eight profiles has no proxy in the country visible to its project, the call stops with a sentence that names that profile and the country, ends "Nothing was changed.", and the first four are as they were. A batch that half-applied and then failed would leave you guessing which rows moved.

When it succeeds, the answer is the same on every surface:

```
POST /api/v1/proxies/assign
{ "profileIds": ["…", "…"], "mode": "country", "country": "DE" }

{ assigned, mode, reused, perProxy,
  assignments: [{ profileId, profileName, proxyId, proxyName }] }

```

`reused` is true when two profiles from this call ended up on one proxy, and `perProxy` is the most any proxy carries. The window turns that into a toast, "8 profiles on DE proxies, sharing", with the detail that up to 2 profiles share each proxy, so some share an IP. MCP's `assign_proxy` returns the same object. The country must be a two-letter code; anything else is refused with the field named.

If the real need is a fresh IP per profile in one country, a provider is the better tool than a list of saved proxies: each profile gets its own session, and [pinning the country, not the address](https://mosaicbrowser.com/blog/pin-the-country-not-the-address) explains why. Country mode is for the proxies you already own, and the bulk bar it lives in is on the [bulk actions](https://mosaicbrowser.com/features/bulk-actions) page.

## Questions

### How do I assign proxies to profiles by country in Mosaic?

Select the profiles, open Assign proxy and pick a country under By country. Through the API it is POST /api/v1/proxies/assign with mode country and a two-letter code; the MCP tool is assign_proxy.

### Which country does Mosaic use for a proxy, the seller's or the measured one?

The measured one, when the proxy's last check succeeded and found a country. Until then it uses the country the proxy was saved with. Each proxy is judged on its own, so one checked proxy and one unchecked one can sit in the same list.

### What happens when there are more profiles than proxies in a country?

Every profile still gets one, and the answer says so: reused turns true and perProxy says the most profiles any one proxy now carries. In the window the same fact arrives as a toast saying some profiles share an IP.

### Can country mode hand out a proxy from another project?

No. The pool is every saved proxy the profile's own project can see, meaning proxies in that project plus proxies available to every project. A proxy scoped to a different project is never chosen.

## Related

[Bulk edit browser profiles: start, tag, move and arrange](https://mosaicbrowser.com/features/bulk-actions): Bulk edit browser profiles in Mosaic: start, stop, edit, tag, move or re-proxy a selection together, arrange its windows, and type into all of them.

[Same proxy session on multiple profiles: forty profiles, forty IPs](https://mosaicbrowser.com/blog/forty-profiles-forty-exits): The same proxy session on multiple profiles means one public IP for all of them. A batch of ours did it in September 2026; now every profile gets its own.

[Match browser timezone to proxy IPs, automatically](https://mosaicbrowser.com/features/exit-matching): No need to match browser timezone to proxy by hand: Mosaic sets each profile's timezone, language and location from the measured IP, before every launch.

[Pin the country, not the address](https://mosaicbrowser.com/blog/pin-the-country-not-the-address): A residential pool moves your IP whatever you do. The checks that matter compare countries, so pin the country and let the address move inside it.

[How to create browser profiles in bulk, each one its own](https://mosaicbrowser.com/guides/create-browser-profiles-in-bulk): Chrome makes profiles one at a time. Mosaic creates up to 500 in one batch, each with its own fingerprint and, from a provider, its own proxy session.







[Why your reCAPTCHA v3 score is low](https://mosaicbrowser.com/guides/why-recaptcha-v3-score-is-low): A low reCAPTCHA v3 score: Google says scores differ by site and action, a shared or flagged IP pulls them down, and an over-quota key answers 0.9.

## Mosaic, on your own computer

The browser this blog is about: its own Chromium, fingerprints from real machines and a proxy IP per profile. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.

Mosaic is a desktop app

Email yourself the link and open it on your computer.
