Proxy setup in Browser Use

Proxies for Browser Use: ProxySettings with username and password on Browser, a sticky IP for the agent's session, why HTTP not SOCKS5, country in the username.

Updated · Prokso editorial team

Connection details
Host
gw.prokso.com
Port
823 HTTP · 824 SOCKS5 - new IP per request · 10000–20000 sticky session, HTTP(S) and SOCKS5
Username and password
in your dashboard, on the plan page

Your dashboard generates ready-made lines in the format you need: choose the country, IP type and protocol.

Key takeaways
  • Host gw.prokso.com, ports 823 (HTTP), 824 (SOCKS5), 10000–20000 (sticky sessions, HTTP or SOCKS5)
  • The username and password are in your dashboard on the plan page
  • Check the IP in the response of the proxied request itself: the My IP page in a browser does not test your script

A step-by-step guide to connecting Prokso proxies in Browser Use. It takes a few minutes.

Step 1. Get the proxy details from your dashboard

Open your plan and copy the host gw.prokso.com, port, username and password. Port 823 is HTTP and 824 is SOCKS5 (both give a new IP for every request); ports 10000–20000 keep one IP (sticky session) for up to 120 minutes and work as both HTTP and SOCKS5 (each port is a separate address). Set the country in the username: username__cr.ua.

Step 2. Install the library

You need Python 3.11 or later. The official way is uv add browser-use; pip install browser-use works too. Put the API key of the model that will drive the agent into a .env file, for example OPENAI_API_KEY=…. This guide is written for version 0.13.

Step 3. Describe the proxy with ProxySettings

Create ProxySettings with the server, username and password fields and pass it as the proxy parameter of Browser. The address is http://gw.prokso.com with a sticky port from 10000-20000; the username and password come from the dashboard generator. The username sets the country: USERNAME__cr.de.

import asyncio
from browser_use import Agent, Browser, ChatOpenAI
from browser_use.browser import ProxySettings
from dotenv import load_dotenv

load_dotenv()

browser = Browser(
    proxy=ProxySettings(
        server="http://gw.prokso.com:10001",
        username="USERNAME",
        password="PASSWORD",
    ),
)


async def main():
    agent = Agent(
        task="Open https://api.ipify.org and return the IP address shown on the page",
        llm=ChatOpenAI(model="gpt-5.6-luna"),
        browser=browser,
    )
    history = await agent.run()
    print(history.final_result())


asyncio.run(main())

Save the code as agent.py next to the .env file and run it: uv run agent.py or python agent.py. You can use any model from the supported list in the Browser Use docs.

Step 4. Give the browser to the agent

Pass the browser you created to the agent with the browser parameter. Browser is the same class as BrowserSession; the docs recommend the shorter name. Browser Use fills in the username and password itself when the proxy asks for them, so there's no sign-in prompt, and neither the agent nor the model sees the password.

Step 5. Why a sticky port

The agent opens pages, clicks and fills in forms within one session, and the website ties that session to the IP, so an address change in the middle of a task looks suspicious and can sign you out. So give the agent a sticky port from 10000-20000 and set the IP hold time in the dashboard (1-120 minutes) with room to spare for the whole task. Keep port 823, with a new IP on every request, for quick one-off checks.

Step 6. HTTP, not SOCKS5

Browser Use answers the sign-in request of an HTTP proxy, and Chromium doesn't send a password to a SOCKS5 proxy. So with a username and password use the http:// scheme. SOCKS5 (socks5://gw.prokso.com:824 or a sticky port) only works with the IP whitelist: add the address of the machine running the agent in the dashboard and leave username and password empty.

Step 7. Check the output

Run the example: the agent opens https://api.ipify.org and prints the IP the website sees. It should be the proxy's address, not yours. A 407 error means a wrong username or password, or the plan has run out of traffic. The My IP page in your own browser won't help here: the script launches its own browser, while yours goes direct.

Several Browser Use agents in parallel, each with its own IP

Each agent needs its own Browser. If agents share one browser, they also share the IP and cookies, and their sessions get mixed up on the website. Give each one either its own sticky port from 10000-20000 or its own session number in the username on port 823. The username is a separate ProxySettings field, so the ; doesn't need URL-encoding.

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

load_dotenv()
PASSWORD = os.environ["PROKSO_PASSWORD"]  # read from .env, not from the code

TASKS = {
    "agent1": "Open https://example.com/catalog and list the first five product names",
    "agent2": "Open https://example.com/delivery and summarise the delivery terms",
}


def make_browser(session):
    return Browser(
        proxy=ProxySettings(
            server="http://gw.prokso.com:823",
            username=f"USERNAME__cr.us;sessid.{session}",  # own IP per agent for about 30 minutes
            password=PASSWORD,
        ),
        allowed_domains=["https://example.com", "*.example.com"],  # the agent stays on this website
    )


async def run(session, task):
    agent = Agent(
        task=task,
        llm=ChatOpenAI(model="gpt-5.6-luna"),
        browser=make_browser(session),
        max_failures=3,
    )
    history = await agent.run(max_steps=25)
    print(session, history.is_done(), history.final_result())


async def main():
    await asyncio.gather(*(run(s, t) for s, t in TASKS.items()))


asyncio.run(main())

allowed_domains keeps the agent on the website from the task: it won't follow ads or wander off to search engines, which saves traffic. By default each Browser gets a temporary profile, so agents don't share cookies. If you set user_data_dir, give every browser its own folder.

Matching IP hold time to max_steps and task length

An agent run is a chain of steps: each step is a model call plus browser actions. step_timeout on Agent limits one step (180 seconds by default), and max_steps in agent.run() limits their number (500 by default). So in the worst case a run lasts far longer than an IP is held.

Set max_steps realistic for the task, measure how long a typical run takes and choose the hold time with room to spare. A session number in the username holds an IP for about 30 minutes; for longer tasks use a sticky port, where the hold time goes up to 120 minutes. A residential or mobile IP can change earlier if the device leaves the network: the port then gets a new IP in the same country, so write tasks so the agent can carry on, for example by reopening the start page.

ProxySettings covers only the traffic of Chromium. Calls to the model's API go from your Python process and don't spend your plan's traffic. Each page the agent opens is loaded in full, with images and scripts, so a precise task with a direct URL costs less than "find it on the internet".

What a Browser Use agent reports when the proxy fails

A navigation error doesn't crash the script: the agent records it in the step and tries again, up to max_failures times (5 by default). After the run history.has_errors() and history.errors() show what happened. Typical messages:

  • net::ERR_PROXY_CONNECTION_FAILED. Chromium can't reach gw.prokso.com: check the port in server and that outgoing connections are allowed on the machine with the agent.
  • net::ERR_TUNNEL_CONNECTION_FAILED. The proxy didn't open a tunnel to the website: the plan has run out of traffic or is paused, the website is on the blocked sites list, or it runs on a closed port.
  • The agent keeps landing on an "access denied" page or a captcha. The website doesn't want automated visits. There's nothing for the agent to do here: stop the task and check the website's rules and our acceptable use policy.

If the proxy does not work

FAQ

Which version is this guide for?

For Browser Use version 0.13. In it the proxy is set with the proxy parameter on Browser. For compatibility with older code, BrowserProfile accepts the same parameters and is passed as Browser(browser_profile=…).

Should I put the proxy password in the agent's task?

No, and you shouldn't: the model reads the task. The username and password live only in ProxySettings, and Browser Use fills them in itself. To keep the password out of the code, read it from a variable in .env.

What does a 407 error mean?

The proxy rejected the username or password. Copy them from the dashboard generator again, with no spaces at the start or end, and check that the plan still has traffic.

Does the traffic to the model's API count against my plan?

No, as long as only ProxySettings is set: it proxies the browser, while the model client connects from your script directly. If you set HTTP_PROXY or HTTPS_PROXY for the whole process, model requests may go through the proxy too.

Can two agents share one sticky port?

Technically yes, but then both go out from one IP, and the website sees two sets of cookies from one address. For separate tasks give each agent its own port or session number.

How many agents can run on one plan?

A plan allows up to 1000 concurrent connections, and a browser opens several connections per page. In practice the limit is the memory of your machine and the model's limits, not the plan.