How to set up an authenticated proxy in Selenium WebDriver

Updated:

Standard ChromeDriver --proxy-server=http://ip:port flags ignore inline user:pass credentials and pop up a blocking login dialog. To use VinaProxy authenticated HTTP(S) proxies cleanly in Selenium, pass your credentials through selenium-wire or load a tiny Chrome onAuthRequired background extension.

Selenium · HTTP Proxy Format
http://user:pass@ip:port (selenium-wire / Chrome proxy extension)
Private IPv4 (datacenter)
🇺🇸 United States
Available
From
₫20,000 / IP / month
≈ $0.74 · billed in VND
Volume pricing
  • 1 IP₫40,000
  • 5+ IPs₫35,000
  • 10+ IPs₫25,000
  • 20+ IPs₫25,000
  • 50+ IPs₫25,000
  • 100+ IPs₫25,000
  • 200+ IPs₫25,000
  • 500+ IPs₫25,000
  • 1000+ IPs₫22,000
  • 2000+ IPs₫20,000
Buy United States
Static residential ISP
🇺🇸 United States
Available
From
₫55,000 / IP / month
≈ $2.04 · billed in VND
Volume pricing
  • 1 IP₫75,000
  • 3+ IPs₫70,000
  • 5+ IPs₫65,000
  • 10+ IPs₫60,000
  • 50+ IPs₫60,000
  • 100+ IPs₫60,000
  • 200+ IPs₫60,000
  • 500+ IPs₫55,000
Buy United States

Two reliable ways to authenticate proxies in Selenium

Choose the approach that matches your language runtime and browser driver:

ApproachConfiguration SyntaxBest For
selenium-wire (Python)seleniumwire_options={'proxy': {'http': 'http://user:pass@ip:port', 'https': 'http://user:pass@ip:port'}}Fastest Python setup; supports hot-swapping proxies mid-session
Chrome Auth ExtensionLoad a zipped extension handling chrome.webRequest.onAuthRequiredStandard Selenium across Python, Java, C#, and undetected-chromedriver
Migrate to Playwrightbrowser.newContext({ proxy: { server, username, password } })Native per-context proxy auth with zero extensions required

Performance tips for Selenium scraping over proxies

  • Set options.page_load_strategy = 'eager' so WebDriver interacts as soon as the DOM is interactive without waiting for slow third-party trackers
  • Use --headless=new (Chrome 109+) if running headless so Chrome extensions and proxy auth work identically to headed mode
  • Disable image rendering via Chrome preferences when scraping text-only product data
  • Always wrap your driver in a try / finally: driver.quit() block to prevent orphaned Chromium processes

Step by step

  1. 1

    Install selenium-wire

    Run pip install selenium-wire in your Python virtual environment.

  2. 2

    Define your VinaProxy proxy dictionary

    Format your credentials as sw_options = {'proxy': {'http': 'http://user:pass@ip:port', 'https': 'http://user:pass@ip:port'}}.

  3. 3

    Launch webdriver.Chrome with seleniumwire_options

    Initialize driver = webdriver.Chrome(seleniumwire_options=sw_options).

  4. 4

    Verify the exit IP address

    Navigate to driver.get('https://vinaproxy.com/api/my-ip') and confirm the JSON response shows your proxy IP.

Frequently asked questions

Why doesn't `--proxy-server=http://user:pass@ip:port` work in ChromeOptions?

Chromium intentionally strips user:pass@ from the command-line --proxy-server flag. Using selenium-wire, an onAuthRequired extension, or Playwright solves this cleanly.

Can I switch proxies without restarting Chrome in selenium-wire?

Yes. Assign a new dictionary to driver.proxy = {'http': 'http://...', 'https': 'http://...'} at any point to switch the active upstream proxy on the fly.

Do Chrome proxy extensions work in headless mode?

Yes, as long as you pass --headless=new instead of the legacy --headless flag.

Run Selenium WebDriver at scale with unmetered static IPs

Instant Dedicated IPv4 and Static ISP proxies across 7 countries.

Buy Selenium Proxies

Related articles

Proxies by platform
Proxies for Web Scraping: unmetered dedicated IPv4 & ISP pools for 24/7 crawlers
High-speed HTTP(S) dedicated IPv4 and Static ISP proxies for Python, Playwright, Selenium, and Scrapy with unlimited monthly bandwidth.
Proxy setup
How to set up a proxy in Playwright (Browser & Per-Context Auth)
Configure authenticated HTTP(S) proxies in Playwright for Node.js and Python. Run multiple isolated static IPs across BrowserContexts.
Proxy setup
How to use a proxy in Python Requests (HTTP/HTTPS & Session pooling)
Configure authenticated HTTP(S) proxies in Python requests and requests.Session(). Handle 407 ProxyError exceptions and rotate static IP pools.
Proxy setup
How to set up an authenticated proxy in Puppeteer (Node.js)
Configure authenticated HTTP(S) proxies in Node.js Puppeteer using the --proxy-server launch flag and await page.authenticate().
Proxies by platform
Proxies for SEO & SERP Tracking: accurate keyword rankings across 7 countries
Track localized keyword rankings, audit geo-redirects, and run Screaming Frog crawls with unmetered dedicated IPv4 and Static ISP proxies.
Proxies by platform
Proxies for Amazon: prevent related-account flags across Seller Central, KDP, and Merch
Prevent Amazon related-account suspensions on Seller Central, KDP, and Merch. Dedicated US Static ISP and UK/Japan private IPv4 proxies.
IPV4 · united states
US Private IPv4 Proxies: Fast, Dedicated American Datacenter IPs
Dedicated US private IPv4 proxies for scraping, rank tracking, ad checks and Amazon research. Static IP, one user per IP, unlimited bandwidth, fast activation.
ISP · united states
US Static ISP Proxies: A Fixed American IP That Looks Like a Home Connection
US static ISP proxies registered to consumer internet providers. A fixed American IP for Amazon sellers, ad accounts and Instagram. Unlimited bandwidth.