Prompt

How do I assign different proxies to different browser sessions?

Technology / Data Infrastructure1 observationLast seen Jul 15, 2026

Latest observation

Jul 15, 2026OpenAI APIWeb search: off

To assign different proxies to different browser sessions, the exact method depends on which browser automation tool you’re using. In general, the idea is:

  • Create a separate browser context/profile/session
  • Launch each session with its own proxy settings
  • Avoid sharing cookies/cache if you want sessions isolated

Here are the common approaches:


1) Selenium

With Selenium, you usually set the proxy per browser instance, not per tab.

Python example

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

def make_driver(proxy):
    options = Options()
    options.add_argument(f'--proxy-server={proxy}')
    return webdriver.Chrome(options=options)

driver1 = make_driver("http://proxy1.example.com:8080")
driver2 = make_driver("http://proxy2.example.com:8080")

driver1.get("https://example.com")
driver2.get("https://example.com")

Notes

  • Each webdriver.Chrome() call is a separate session.
  • If the proxy requires auth, Selenium alone is awkward; you may need:
    • a proxy extension,
    • a local proxy wrapper,
    • or tools like selenium-wire.

2) Playwright

Playwright supports proxies nicely, and the proxy is typically set when you create a browser context or browser.

Python example

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch()

    context1 = browser.new_context(proxy={
        "server": "http://proxy1.example.com:8080"
    })
    page1 = context1.new_page()

    context2 = browser.new_context(proxy={
        "server": "http://proxy2.example.com:8080"
    })
    page2 = context2.new_page()

    page1.goto("https://example.com")
    page2.goto("https://example.com")

Notes

  • Playwright contexts are isolated, which is great for separate sessions.
  • Depending on the version and browser, proxy support is often easiest by launching separate browser instances if you run into limitations.

3) Puppeteer

Puppeteer usually sets proxy at browser launch.

Example

const browser1 = await puppeteer.launch({
  args: ['--proxy-server=http://proxy1.example.com:8080']
});

const browser2 = await puppeteer.launch({
  args: ['--proxy-server=http://proxy2.example.com:8080']
});

Notes

  • For different proxies, you generally need different browser instances.
  • Separate incognito contexts do not always let you set different proxies unless using additional tooling or launching separate browsers.

4) Chrome profiles manually

If you’re using regular Chrome, you can assign proxies via:

  • browser launch flags,
  • OS-level proxy settings,
  • or separate profiles with different startup shortcuts.

Example shortcut flags:

chrome --user-data-dir="/tmp/profile1" --proxy-server="http://proxy1.example.com:8080"
chrome --user-data-dir="/tmp/profile2" --proxy-server="http://proxy2.example.com:8080"

This gives you two isolated browser profiles with different proxies.


5) If you need many rotating proxies

If you’re managing many sessions, consider:

  • Playwright/Selenium with one browser instance per proxy
  • a proxy pool
  • a session manager that maps session IDs to proxies
  • a tool like Browserless, Multilogin, GoLogin, or Incogniton for persistent isolated profiles

Important caveats

  • One browser session = one proxy is usually easiest.
  • A proxy is often applied at launch time, not dynamically per page.
  • Switching proxies mid-session can break cookies, authentication, or fingerprints.
  • If your proxies use username/password auth, the setup differs.

If you tell me which stack you’re using (Selenium, Playwright, Puppeteer, Chrome, Firefox, Node.js, Python, etc.), I can give you an exact working example.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.