Skip to content

Browser Use Proxy: Run an Agent Through an HTTP Proxy

Browser Use runs a browser for an AI agent. If that browser has to reach pages through a proxy, you set it once on the Browser object. This guide covers the current API, one proxy per agent, the same options in plain Playwright and Playwright MCP, matching the time zone and language, and common errors.

The current Browser Use proxy API

Browser Use documents the proxy as a parameter of the browser: proxy takes a ProxySettings object with server, username, password and bypass. Browser is an alias for BrowserSession, so Browser(proxy=...) is the whole setup.

BrowserConfig, which older tutorials import, comes from older releases and is not in the current API; code that imports it fails with an ImportError. Use the example below instead.

Browser Use with ProxySettings: check the exit first

import asyncio
import os
from browser_use import Agent, Browser, ChatOpenAI
from browser_use.browser.profile import ProxySettings

browser = Browser(
    proxy=ProxySettings(
        server=f"http://{os.environ['PROXY_HOST']}:{os.environ['PROXY_PORT']}",  # HTTP endpoint
        username=os.environ["PROXY_USER"],
        password=os.environ["PROXY_PASS"],
        bypass="localhost,127.0.0.1",  # optional
    )
)


async def main():
    agent = Agent(
        task=(
            "Open https://ipinfo.io/json and report the IP address and country it shows. "
            "Then continue with the real task."
        ),
        llm=ChatOpenAI(model=os.environ["LLM_MODEL"]),
        browser=browser,
    )
    history = await agent.run()
    print(history.final_result())


asyncio.run(main())

Example only: replace the environment variables with your own values. The task asks the agent to report the exit IP and country before it does anything else.

Why check the exit first

The first step turns "the proxy is configured" into "the agent's browser really shows the country I chose". Do it at the start of every run, and compare the country with the one you chose when you generated the proxy.

bypass is a comma-separated list of hosts that do not go through the proxy, for example localhost,127.0.0.1. Leave it out if you do not need it.

One proxy per agent

Give each agent its own Browser with its own ProxySettings, and run the agents together with asyncio.gather. A proxy belongs to the browser it was set on, so two agents never share an exit by accident. Browser Use's own parallel example is marked experimental, so keep one agent per Browser object.

Two agents, two proxies, run in parallel

import asyncio
import os
from browser_use import Agent, Browser, ChatOpenAI
from browser_use.browser.profile import ProxySettings


def make_browser(host_env, port_env, user_env, pass_env):
    return Browser(
        proxy=ProxySettings(
            server=f"http://{os.environ[host_env]}:{os.environ[port_env]}",
            username=os.environ[user_env],
            password=os.environ[pass_env],
        )
    )


async def run_one(task, browser):
    agent = Agent(task=task, llm=ChatOpenAI(model=os.environ["LLM_MODEL"]), browser=browser)
    return await agent.run()


async def main():
    de = make_browser("DE_HOST", "DE_PORT", "DE_USER", "DE_PASS")
    jp = make_browser("JP_HOST", "JP_PORT", "JP_USER", "JP_PASS")
    results = await asyncio.gather(
        run_one("Open https://ipinfo.io/json and report the IP and country", de),
        run_one("Open https://ipinfo.io/json and report the IP and country", jp),
    )
    for history in results:
        print(history.final_result())


asyncio.run(main())

Example only: replace the placeholder values with your own.

The same proxy in plain Playwright

Browser Use drives Chromium through Playwright, so Playwright's own proxy options are worth knowing. The proxy can be set for the whole browser in launch, or for one browser context in new_context (newContext in Node.js), and the options are server, bypass, username and password.

The Playwright option reference says username and password are for HTTP proxies. So an authenticated SOCKS5 proxy is not a Chromium option: use the HTTP endpoint. On Proxy302 that is proxy.proxy302.com port 2222; SOCKS5 is port 3333.

Playwright for Python: launch-level and per-context proxy

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    # Proxy for the whole browser
    browser = p.chromium.launch(
        proxy={
            "server": "http://HOST:PORT",
            "username": "USERNAME",
            "password": "PASSWORD",
            "bypass": "localhost,127.0.0.1",
        }
    )
    page = browser.new_page()
    page.goto("https://ipinfo.io/json")
    print(page.inner_text("body"))
    browser.close()

    # Or one proxy per context
    browser = p.chromium.launch()
    context = browser.new_context(
        proxy={"server": "http://HOST:PORT", "username": "USERNAME", "password": "PASSWORD"}
    )
    page = context.new_page()
    page.goto("https://ipinfo.io/json")
    print(page.inner_text("body"))
    browser.close()

Example only: replace the placeholder values with your own.

Playwright for Node.js: launch-level and per-context proxy

import { chromium } from 'playwright';

// Proxy for the whole browser
const browser = await chromium.launch({
  proxy: {
    server: 'http://HOST:PORT',
    username: 'USERNAME',
    password: 'PASSWORD',
    bypass: 'localhost,127.0.0.1',
  },
});
const page = await browser.newPage();
await page.goto('https://ipinfo.io/json');
console.log(await page.innerText('body'));
await browser.close();

// Or one proxy per context
const browser2 = await chromium.launch();
const context = await browser2.newContext({
  proxy: { server: 'http://HOST:PORT', username: 'USERNAME', password: 'PASSWORD' },
});
const page2 = await context.newPage();
await page2.goto('https://ipinfo.io/json');
console.log(await page2.innerText('body'));
await browser2.close();

Example only: replace the placeholder values with your own.

Playwright MCP

If you drive the browser through the Playwright MCP server instead of Python code, the equivalents are the --proxy-server and --proxy-bypass arguments. The README puts the credentials in the proxy URL: http://user:password@host:port. If the password has special characters such as @, : or /, percent-encode them.

The same README lists SOCKS5 in the URL form, but as with Playwright above, use the HTTP endpoint when you need a username and password.

Playwright MCP with a proxy: mcpServers entry

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp@latest",
        "--proxy-server",
        "http://USER:PASS@HOST:PORT",
        "--proxy-bypass",
        "localhost,127.0.0.1"
      ]
    }
  }
}

Example only: replace the placeholder values with your own.

Fetching a page through a proxy from an MCP client

If you only need an agent to read a public page through a Proxy302 proxy, without running a browser, see the proxy-mcp-server guide. proxy302-mcp is the official Proxy302 MCP server, open source on GitHub and maintained by the Proxy302 team. Proxy302 also runs it at https://proxy302.com/v1/mcp: clients that can send an Authorization header, such as Claude Code, Cursor and VS Code, connect with an API key and install nothing.

Time zone and language for the exit region

Some sites show a different currency, language or shipping text depending on where the visitor appears to be. To see the local version of a page, set the browser's language and time zone to the exit region as well as the proxy.

Playwright's context options for this are locale (a language tag such as de-DE) and timezone_id (a time zone ID such as Europe/Berlin; timezoneId in Node.js). Both are listed in the official options. They change what the browser reports; the proxy changes the address.

Python: proxy, locale and time zone in one context

context = browser.new_context(
    proxy={"server": "http://HOST:PORT", "username": "USERNAME", "password": "PASSWORD"},
    locale="de-DE",
    timezone_id="Europe/Berlin",
)

Example only: replace the placeholder values with your own.

Node.js: proxy, locale and time zone in one context

const context = await browser.newContext({
  proxy: { server: 'http://HOST:PORT', username: 'USERNAME', password: 'PASSWORD' },
  locale: 'de-DE',
  timezoneId: 'Europe/Berlin',
});

Example only: replace the placeholder values with your own.

Measured exits seen from Amazon

Measured exits seen from Amazon
ItemNetwork (ISP)ASNResponse, ms
United StatesAT&T Enterprises, LLCAS70181807
United KingdomPlusnetAS68712563
GermanyVodafone GmbHAS32091058
JapanBTV CO.,LTD.AS181351548
SingaporeStarhub LtdAS55430629
RussiaPJSC VimpelcomAS84022031
BrazilTELEFÔNICA BRASIL S.AAS265996263
IndonesiaPT. Telekomunikasi SelularAS236931752

Hourly check of the Proxy302 probe, 3 November 2026, 18:18 UTC: one request to Amazon per country through a rotating residential exit. Only the first three octets of an IP are public. One sample per country, not an average; later checks will differ.

Common errors and fixes

407 Proxy Authentication Required

Check The proxy received the request but did not accept the credentials. Check that ProxySettings or the proxy dict really has username and password, that they match the ones in My assets, and that the port matches the protocol.

Fix Fix the credentials; use the HTTP endpoint (port 2222) in Chromium. If you put them into a URL, percent-encode special characters.

ERR_PROXY_CONNECTION_FAILED

Check The browser could not open a connection to the proxy at all. Check the host and port, that the scheme is http://, and that no other proxy setting is layered on top.

Fix Correct the host, port or scheme and run the exit check again. From mainland China, keep the Helper open (see the steps below).

Timeouts

Check A page that loads without the proxy but times out with it points at the proxy path or the page, not at your code. Try the same request from another exit country.

Fix Raise the navigation timeout for slow pages and retry from a closer country.

The site shows the wrong country

Check The exit may differ from what you chose, or the browser's time zone and language differ from the exit region. Run the IP lookup task again right before the real task.

Fix Set locale and timezone_id for the exit country; for multi-step tasks use a static IP.

What to use it for

Typical uses are reading public pages, checking how a page looks in another region, QA of a localized site, and collecting data in line with the site's terms and rate limits. A proxy changes only the network address a service sees; keep your request rate polite and follow each site's rules.

How to do it with Proxy302

Rotating residential fits agents that read many pages or check several regions: pick the country, generate a proxy as HTTP, and use proxy.proxy302.com port 2222. A static ISP IP fits an agent that signs in to an account and needs one fixed address. See the rotating residential page for the product.

How to do it with Proxy302: steps

  1. Step 1

    Open the rotating residential page (or the static ISP page), choose the country and the protocol HTTP, and generate the proxy.

  2. Step 2

    Open My assets (the console page that holds everything you bought) and copy HOST, PORT, USERNAME and PASSWORD. The Connect page shows a ready example with your own endpoint.

  3. Step 3

    Put them into ProxySettings, the Playwright proxy option or the MCP argument.

  4. Step 4

    Run the exit check: ask the agent to open https://ipinfo.io/json and report the IP and country. The country should match the one you chose.

  5. Step 5

    From mainland China, open the Helper from the Connect page, click 「一键加速」 (One-click boost) and keep it open while you use the proxy.

Prices and limits

Rotating residential costs from US$1.50 per GB on the Budget line and US$5 per GB on the Premium line, less in larger packages. A static ISP IP costs US$0.50 for one day and US$7.99 for 30 days. There is no free trial: the smallest purchase is 1 GB or one IP for one day. A proxy does not lift a restriction, undo a ban or raise a limit.

Proxy302 at a glance

Proxy302 at a glance
ItemPriceProtocolsLocationsFits agent work like
Rotating residentialFrom US$1.50 per GB (Budget line); US$5 per GB (Premium line); lower per GB in larger packagesHTTP, SOCKS5195+ countries and regions; state and city on lines that support itBrowsing and research agents, data collection
Static ISP, per IPUS$0.50 for 1 day, US$7.99 for 30 days, the same in every countryHTTP or SOCKS5, chosen per IP30 countries on the order form; stock changes dailyOne fixed IP for each account an agent signs in to
ISP for AI subscriptionsPer 30 days: Claude 15 PTC, GPT / Grok 10 PTC, Gemini 8 PTC; the first order in each tier is 50% offHTTP or SOCKS5Claude: US, UK, DE, ES, JP, SG. GPT / Grok and Gemini: US, UK, FR, ES, IT, JP, KR, SGCoding tools and agents signed in to ChatGPT, Claude, Gemini or Grok
Datacenter, per IPUS$0.25 for 1 day, US$3.99 for 30 daysHTTP or SOCKS5, chosen per IP8 countriesAPI calls and tool traffic where the IP type does not matter
proxy302-mcpFree, open source (MIT)MCP over stdio, started with npxUses the products aboveLets Claude Code, Codex, Cursor and other MCP clients get a proxy and fetch pages through it

Prices are in PTC, paid from the wallet; 1 PTC = US$1. There is no free trial: the smallest purchase is 1 GB of rotating residential traffic or one IP for one day. Checked on 4 November 2026.

FAQ

Does Browser Use have a built-in proxy setting?

Yes. Pass proxy=ProxySettings(server, username, password, bypass) to Browser. BrowserConfig is from older releases and is not in the current API.

How do I give each parallel agent its own proxy?

Create one Browser per agent, each with its own ProxySettings, and run the agents with asyncio.gather.

Can I use SOCKS5 with a username and password in Chromium?

No. Playwright's username and password options are for HTTP proxies, so use the HTTP endpoint (port 2222 on proxy.proxy302.com).

Should I rotate the IP or keep one?

Keep one IP when the pages in a task belong to one visit, such as a login and a few steps. For independent single-page reads a new IP per task is simpler.

Why does a site still show the wrong region?

Check the exit IP first. Then set the context's locale and timezone_id to the exit region, which controls what the browser reports.

Reference links

11
  1. Browser Use docs: all parameters

    Official documentation · Confirmed on:

    Read on 4 November 2026: the proxy parameter takes ProxySettings(server, bypass, username, password); Browser is an alias for BrowserSession; BrowserProfile can be passed to Browser.

  2. Browser Use source: browser/profile.py

    Official documentation · Confirmed on:

    Source read on 4 November 2026: class ProxySettings has server, bypass, username and password; BrowserProfile.proxy; the current package exports Browser and BrowserSession and has no BrowserConfig.

  3. Playwright docs: Network, HTTP proxy

    Official documentation · Confirmed on:

    Read on 4 November 2026: proxy can be set for the whole browser in launch or for each context; username and password for HTTP(S) proxy.

  4. Playwright docs: proxy option reference

    Official documentation · Confirmed on:

    Read on 4 November 2026: server, bypass, username, password; username and password are for HTTP proxy authentication.

  5. Playwright for Python: Browser.new_context

    Official documentation · Confirmed on:

    Read on 4 November 2026: locale, timezone_id and proxy options of new_context.

  6. Playwright docs: Emulation, locale and timezone

    Official documentation · Confirmed on:

    Read on 4 November 2026: locale and timezoneId in browser.newContext; they affect the browser's locale and time zone only.

  7. Playwright MCP README

    Official documentation · Confirmed on:

    Read on 4 November 2026: --proxy-server (including the http://user:password@host:port form) and --proxy-bypass.

  8. Proxy302 product facts and price list

    Product observation · Confirmed on:

    Product facts file of the site (values checked against the console, the backend and the price table on 18-19 October 2026): products, prices in US$ (1 PTC = US$1), lease terms, protocols and ports, countries, quantity limits, no free trial.

  9. Proxy302 ISP for AI subscriptions: public catalog

    Product observation · Confirmed on:

    Public JSON at proxy302.com/v1/proxy/ai-isp/catalog, read 4 November 2026: three tiers (Claude, GPT / Grok, Gemini), price per 30 days in PTC, 50% off the first order in a tier, cities by country.

  10. proxy302-mcp README (official Proxy302 MCP server)

    Product observation · Confirmed on:

    README of the official Proxy302 MCP server: install commands, environment variables, the seven tools, the read-only, spend-free scope and the hosted endpoint https://proxy302.com/v1/mcp.

  11. Proxy302 hourly connectivity check

    Product observation · Confirmed on:

    Public JSON of the probe at proxy302.com/live/connectivity/amazon.json (file probe-amazon-20261104.json), generated 3 November 2026, 18:18 UTC: one request per exit country through a rotating residential exit; exit ASN, network and response time.

Ready to try it?

Create an account, top up once, then pick rotating residential, static ISP or datacenter IPs and have one running in your browser within minutes.