DEV Community

Cover image for Selenium proxy setup: auth, SOCKS5, Firefox and rotation
Andrew
Andrew

Posted on Originally published at proxymint.com

Selenium proxy setup: auth, SOCKS5, Firefox and rotation

Originally published on proxymint.

Set a Selenium proxy in Chrome and Firefox, add username and password auth tested on Selenium 4.50 and Chrome 154, fix SOCKS5 errors and rotate per driver.

TL;DR

  • Chrome takes a Selenium proxy as host and port only. The --proxy-server flag and Selenium's Proxy object both set the exit, and neither has a working field for an HTTP proxy password.
  • A missing password fails silently. On Selenium 4.50 with Chrome 154, a proxy 407 with no answer left a blank page and driver.get() raised nothing, headless or headed.
  • An MV3 extension or a CDP handler supplies the credentials. Installed through webextension.install(), the extension authenticated on the first navigation; branded Chrome has ignored --load-extension since version 137.
  • selenium-wire is archived. The repository was archived on 2024-01-03, and a fresh install on 2026-10-06 failed on import, then failed on HTTPS pages once pinned.
  • Chrome cannot send a SOCKS5 password. A password-protected SOCKS5 server fails with net::ERR_SOCKS_CONNECTION_FAILED, so use the provider's HTTP endpoint.

Key takeaways

  • Make an IP lookup the first page of every driver. Parse the response and assert the country, so a blank page raises an error instead of feeding empty results to the job.
  • Install the auth extension through BiDi on branded Chrome. Use --load-extension only on Chrome for Testing or Chromium, and wait for the extension before the first navigation.
  • Rotate by driver, not by request. Give each driver one sticky session or one fixed IP, and quit it to change the exit together with cookies and cache.
  • Set the language through Chrome prefs. intl.accept_languages changed the Accept-Language header in headless Chrome 154, while --lang did not.

Read the full guide on proxymint, with the commands, tables and sources.

Top comments (0)