Prompt

How do I use proxies with Playwright?

Technology / Data Infrastructure1 observationLast seen Jul 15, 2026

Latest observation

Jul 15, 2026OpenAI APIWeb search: off

You can use proxies with Playwright by configuring them when you launch the browser, or per browser context in some cases.

1) Set a proxy when launching the browser

This is the most common approach.

JavaScript / TypeScript

import { chromium } from 'playwright';

const browser = await chromium.launch({
  proxy: {
    server: 'http://proxy.example.com:3128',
    username: 'myuser',
    password: 'mypassword',
  }
});

const page = await browser.newPage();
await page.goto('https://example.com');

Python

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(
        proxy={
            "server": "http://proxy.example.com:3128",
            "username": "myuser",
            "password": "mypassword",
        }
    )
    page = browser.new_page()
    page.goto("https://example.com")

2) Proxy for a browser context

This is useful when you want separate proxies for different contexts.

JavaScript / TypeScript

const browser = await chromium.launch();

const context = await browser.newContext({
  proxy: {
    server: 'http://proxy.example.com:3128',
    username: 'myuser',
    password: 'mypassword',
  }
});

const page = await context.newPage();
await page.goto('https://example.com');

Python

browser = p.chromium.launch()
context = browser.new_context(
    proxy={
        "server": "http://proxy.example.com:3128",
        "username": "myuser",
        "password": "mypassword",
    }
)
page = context.new_page()
page.goto("https://example.com")

3) Proxy syntax

Common formats for server:

  • http://host:port
  • https://host:port
  • socks5://host:port

Example:

proxy: { server: 'socks5://127.0.0.1:1080' }

4) Proxy authentication

If your proxy requires authentication, include:

proxy: {
  server: 'http://proxy.example.com:3128',
  username: 'user',
  password: 'pass',
}

5) Environment variables

Playwright does not rely on HTTP_PROXY / HTTPS_PROXY automatically for browser traffic the way some HTTP clients do. For browser navigation, prefer Playwright’s proxy option.

6) Notes

  • The proxy applies to browser traffic, not necessarily to all system/network requests.
  • If you need different proxies for different sessions, use separate browser contexts or separate browser instances.
  • For playwright.request / APIRequestContext, proxy settings can be configured separately if needed.

If you want, I can show:

  • a rotating proxy setup,
  • how to use proxies with Playwright Test,
  • or examples for Chromium/Firefox/WebKit specifically.

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.