{"id":289,"date":"2026-11-13T09:30:00","date_gmt":"2026-11-13T04:00:00","guid":{"rendered":"https:\/\/proxykite.com\/blog\/?p=289"},"modified":"2026-11-13T09:30:00","modified_gmt":"2026-11-13T04:00:00","slug":"selenium-proxy-authentication","status":"publish","type":"post","link":"https:\/\/proxykite.com\/blog\/selenium-proxy-authentication\/","title":{"rendered":"Selenium Proxy Setup With Username and Password"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A selenium proxy configuration is easy until the endpoint requires a username and password. Chrome accepts the proxy host and port in <code>--proxy-server<\/code>, but it does not use <code>user:pass@host:port<\/code> there as a complete login flow. This guide shows three working approaches in Python, plus SOCKS5, IP rotation between browser sessions, and an exit-IP check.<\/p>\n\n\n\n<aside class=\"ap-card\" aria-label=\"ProxyKite per-dongle licence\">\n<span class=\"ap-card__badge\">For your own dongles<\/span>\n<div class=\"ap-card__body\"><p class=\"ap-card__name\">ProxyKite per-dongle licence<\/p><p class=\"ap-card__best\">Best for anyone turning their own 4G\/LTE dongles + SIMs into HTTP\/SOCKS5 mobile proxies, from 1 dongle to hundreds<\/p><ul class=\"ap-card__features\"><li>Every dongle becomes an HTTP + SOCKS5 proxy on a public port of our cloud router \u2014 no static IP or port forwarding, works behind CGNAT<\/li><li>IP rotation on demand, by rotation link, or on a timer from 60 s to 7 days (sticky option); returns old + new IP<\/li><li>One-line installer on a Raspberry Pi \/ Linux box; Huawei E3372 HiLink is the reference stick<\/li><li>SIM inbox for carrier messages, bandwidth limits per day\/week\/month, live traffic insights<\/li><li>Sub-users, white-label (your logo\/colours), REST API, webhooks and Telegram alerts included<\/li><li>Flat price, traffic is free \u2014 rides on your own SIM data plans<\/li><\/ul><\/div>\n<div class=\"ap-card__side\"><p class=\"ap-card__price\">$9 per dongle <small>per month<\/small><\/p><a class=\"ap-card__btn\" href=\"https:\/\/proxykite.com\/#pricing\">Talk to us \u2192<\/a><\/div>\n<\/aside>\n\n\n\n<h2 class=\"wp-block-heading\">What you need<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Have these values ready before changing Selenium code:<\/p>\n\n\n\n<figure class=\"wp-block-table ap-table\"><table><thead><tr><th>Value<\/th><th>Example<\/th><th>Used for<\/th><\/tr><\/thead><tbody><tr><td>Proxy scheme<\/td><td><code>http<\/code> or <code>socks5<\/code><\/td><td>Tells the client how to connect<\/td><\/tr><tr><td>Host<\/td><td><code>proxy.example.net<\/code><\/td><td>Proxy server name<\/td><\/tr><tr><td>Port<\/td><td><code>30007<\/code><\/td><td>Proxy listener<\/td><\/tr><tr><td>Username<\/td><td><code>u7abc<\/code><\/td><td>User:pass authentication<\/td><\/tr><tr><td>Password<\/td><td><code>s3cret<\/code><\/td><td>Matching proxy secret<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You also need Python, Selenium 4, Chrome and a matching ChromeDriver. Test one harmless URL before adding your real workflow. Keep credentials in environment variables or a secret store, not in a committed <code>.py<\/code> file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ProxyKite endpoints support HTTP and SOCKS5 access with either user:pass or IP whitelist authentication. Its <a href=\"https:\/\/proxykite.com\/docs\/guide\/authentication\">authentication guide<\/a> explains the difference between proxy credentials and API tokens; they are not interchangeable.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/proxykite.com\/blog\/wp-content\/uploads\/2026\/10\/selenium-proxy-authentication-1.webp\" alt=\"ProxyKite\u2019s authentication documentation separates API tokens from the credentials used by proxy traffic.\"\/><figcaption class=\"wp-element-caption\">ProxyKite\u2019s authentication documentation separates API tokens from the credentials used by proxy traffic.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Why Chrome ignores <code>user:pass<\/code> in <code>--proxy-server<\/code><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Selenium configures a browser proxy as a network endpoint. The official <a href=\"https:\/\/www.selenium.dev\/documentation\/webdriver\/drivers\/options\/#proxy\" target=\"_blank\" rel=\"noopener\">Selenium proxy documentation<\/a> shows a proxy host and port as the capability; authentication is a separate challenge-response step.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This line selects a proxy endpoint:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>options.add_argument(\"--proxy-server=http:\/\/proxy.example.net:30007\")<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This looks plausible, but is not a reliable way to answer the proxy&#8217;s <code>Proxy-Authenticate<\/code> challenge:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>options.add_argument(\n    \"--proxy-server=http:\/\/u7abc:s3cret@proxy.example.net:30007\"\n)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the proxy rejects the request, Chrome can show a login prompt or the session can fail with HTTP 407. The browser must receive the credentials through a supported authentication handler, or the proxy must identify the client by its public IP instead.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Test the endpoint outside Selenium<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why: a small request tells you whether the problem is reachability, proxy authentication, or browser configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run this from the same machine that will run Chrome:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl --fail --show-error --max-time 30 \\\n  --proxy 'http:\/\/proxy.example.net:30007' \\\n  --proxy-user 'u7abc:s3cret' \\\n  'https:\/\/example.com\/' \\\n  -o \/dev\/null<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For a password containing <code>@<\/code>, <code>:<\/code>, <code>\/<\/code>, <code>?<\/code>, <code>#<\/code>, or <code>%<\/code>, keep the values in separate fields where possible. When a URL is unavoidable, percent-encode the username and password exactly once. The <a href=\"https:\/\/proxykite.com\/docs\/guide\/proxy-formats\">ProxyKite proxy formats guide<\/a> has the supported <code>host:port:user:pass<\/code> and URL-style forms.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Success means curl reaches the destination without a second 407. If curl cannot resolve the host or connect to the port, fix the endpoint first. If it returns 407, confirm the proxy mode, credentials, and allowlist before debugging Selenium.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Option 1: Use an IP whitelist with Selenium<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why: an allowlisted public IP removes the browser credential challenge entirely.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is the simplest Selenium setup when the browser always runs from a known network. Add that network&#8217;s current public egress IP to the proxy allowlist, then use only the host and port in Chrome:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from selenium import webdriver\nfrom selenium.webdriver.chrome.options import Options\n\nPROXY_HOST = \"proxy.example.net\"\nPROXY_PORT = 30007\n\noptions = Options()\noptions.add_argument(f\"--proxy-server=http:\/\/{PROXY_HOST}:{PROXY_PORT}\")\n\ndriver = webdriver.Chrome(options=options)\ntry:\n    driver.get(\"https:\/\/example.com\/\")\n    print(driver.title)\nfinally:\n    driver.quit()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The allowlisted address must be the public address seen by the proxy. A private address such as <code>192.168.1.20<\/code> is not the same thing. If the worker moves between home, office and cloud networks, an IP whitelist needs to be updated for each egress path; user:pass authentication is usually more convenient for that case.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Success looks like the page loads without a browser authentication prompt. If the same code returns 407, check whether the current network has changed, whether a VPN is active, and whether the endpoint is configured for user:pass instead of whitelist mode.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Option 2: Handle proxy auth with a Chrome extension<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why: a small Manifest V3 extension can answer Chrome&#8217;s proxy authentication event while keeping the credentials out of the proxy command line.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Chrome&#8217;s <a href=\"https:\/\/developer.chrome.com\/docs\/extensions\/reference\/api\/webRequest\" target=\"_blank\" rel=\"noopener\">official <code>webRequest<\/code> documentation<\/a> documents <code>onAuthRequired<\/code>, the <code>isProxy<\/code> flag, and the <code>webRequestAuthProvider<\/code> permission. The example below uses the asynchronous <code>asyncBlocking<\/code> mode required by current Manifest V3 extension handling.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create an unpacked extension at runtime and load it into this browser session:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import json\nimport tempfile\nfrom pathlib import Path\n\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.options import Options\n\nPROXY_HOST = \"proxy.example.net\"\nPROXY_PORT = 30007\nPROXY_USER = \"u7abc\"\nPROXY_PASS = \"s3cret\"\n\nmanifest = {\n    \"manifest_version\": 3,\n    \"name\": \"Selenium proxy authentication\",\n    \"version\": \"1.0.0\",\n    \"permissions\": [\"webRequest\", \"webRequestAuthProvider\"],\n    \"host_permissions\": [\"&lt;all_urls&gt;\"],\n    \"background\": {\"service_worker\": \"background.js\"},\n}\n\nbackground_js = f\"\"\"\nconst PROXY_HOST = {json.dumps(PROXY_HOST)};\nconst PROXY_PORT = {PROXY_PORT};\nconst PROXY_USER = {json.dumps(PROXY_USER)};\nconst PROXY_PASS = {json.dumps(PROXY_PASS)};\n\nchrome.webRequest.onAuthRequired.addListener(\n  (details, callback) =&gt; {{\n    const isOurProxy = details.isProxy &amp;&amp;\n      details.challenger.host === PROXY_HOST &amp;&amp;\n      details.challenger.port === PROXY_PORT;\n\n    if (!isOurProxy) {{\n      callback();\n      return;\n    }}\n\n    callback({{ authCredentials: {{\n      username: PROXY_USER,\n      password: PROXY_PASS\n    }} }});\n  }},\n  {{ urls: [\"&lt;all_urls&gt;\"] }},\n  [\"asyncBlocking\"]\n);\n\"\"\"\n\nwith tempfile.TemporaryDirectory() as extension_path:\n    extension_dir = Path(extension_path)\n    (extension_dir \/ \"manifest.json\").write_text(\n        json.dumps(manifest), encoding=\"utf-8\"\n    )\n    (extension_dir \/ \"background.js\").write_text(\n        background_js, encoding=\"utf-8\"\n    )\n\n    options = Options()\n    options.add_argument(f\"--proxy-server=http:\/\/{PROXY_HOST}:{PROXY_PORT}\")\n    options.add_argument(f\"--load-extension={extension_dir}\")\n\n    driver = webdriver.Chrome(options=options)\n    try:\n        driver.get(\"https:\/\/example.com\/\")\n        print(driver.title)\n    finally:\n        driver.quit()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The host and port check prevents the extension from offering the proxy password to an ordinary website login. Keep the extension directory private and short-lived. If a managed Chrome policy prevents unpacked extensions, use an IP whitelist or the Selenium Wire option below.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Success looks like a normal page load with no 407 prompt. If the extension does not load, open the browser without headless mode and inspect the extension error; the most common causes are a missing permission, a malformed manifest, or a Chrome policy that blocks the load.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Option 3: Use Selenium Wire for user:pass auth<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why: Selenium Wire runs a local forwarding layer and accepts the authenticated upstream proxy as a URL, so it handles the credentials before traffic reaches Chrome.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install it in the environment used by the test runner:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python -m pip install selenium selenium-wire<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then configure both HTTP and HTTPS destinations. <code>quote()<\/code> protects reserved characters in the credentials when they are embedded in a URL:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import os\nfrom urllib.parse import quote\n\nfrom seleniumwire import webdriver\n\nPROXY_HOST = os.environ[\"PROXY_HOST\"]\nPROXY_PORT = os.environ[\"PROXY_PORT\"]\nPROXY_USER = quote(os.environ[\"PROXY_USER\"], safe=\"\")\nPROXY_PASS = quote(os.environ[\"PROXY_PASS\"], safe=\"\")\n\nproxy_url = (\n    f\"http:\/\/{PROXY_USER}:{PROXY_PASS}@\"\n    f\"{PROXY_HOST}:{PROXY_PORT}\"\n)\n\nseleniumwire_options = {\n    \"proxy\": {\n        \"http\": proxy_url,\n        \"https\": proxy_url,\n        \"no_proxy\": \"localhost,127.0.0.1\",\n    },\n    \"disable_capture\": True,\n}\n\ndriver = webdriver.Chrome(seleniumwire_options=seleniumwire_options)\ntry:\n    driver.get(\"https:\/\/example.com\/\")\n    print(driver.title)\nfinally:\n    driver.quit()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <a href=\"https:\/\/github.com\/wkeeling\/selenium-wire\" target=\"_blank\" rel=\"noopener\">Selenium Wire documentation<\/a> supports this proxy shape and also documents <code>socks5:\/\/<\/code> and <code>socks5h:\/\/<\/code>. It is useful when you need a quick Python integration, but the repository is archived and no longer maintained. For a long-lived production runner, prefer IP allowlisting or the browser-native extension when those fit your deployment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Success looks like the browser loads the destination and the script exits cleanly. A TLS warning can indicate that the local interception certificate is not trusted; it is separate from a proxy 407 and should not be \u201cfixed\u201d by disabling TLS verification in a production job.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">SOCKS5 with Selenium<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Selenium can point Chrome at an unauthenticated SOCKS5 endpoint directly:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from selenium import webdriver\nfrom selenium.webdriver.chrome.options import Options\n\noptions = Options()\noptions.add_argument(\n    \"--proxy-server=socks5:\/\/proxy.example.net:30007\"\n)\n\ndriver = webdriver.Chrome(options=options)\ntry:\n    driver.get(\"https:\/\/example.com\/\")\nfinally:\n    driver.quit()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For a SOCKS5 endpoint with username and password, use the Selenium Wire pattern and change the URL scheme:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>proxy_url = \"socks5:\/\/u7abc:s3cret@proxy.example.net:30007\"\n\nseleniumwire_options = {\n    \"proxy\": {\n        \"http\": proxy_url,\n        \"https\": proxy_url,\n        \"no_proxy\": \"localhost,127.0.0.1\",\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use <code>socks5h:\/\/<\/code> when you need DNS resolution to happen through the proxy. Otherwise, <code>socks5:\/\/<\/code> is enough for many browser tests. The <a href=\"https:\/\/proxykite.com\/docs\/guide\/proxy-formats\">ProxyKite proxy formats guide<\/a> shows the protocol-specific forms; do not label an HTTP endpoint as SOCKS5 just because the destination URL uses HTTPS.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Rotate the IP between Selenium sessions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Do not rotate a dongle in the middle of a multi-step browser flow. Existing connections and cookies may no longer represent the same mobile session. Close the driver, rotate the specific proxy, verify the response, then create a fresh driver.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ProxyKite rotation links are control URLs for one proxy. Call the link directly, not through the proxy you are rotating:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import os\nimport requests\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.options import Options\n\nROTATE_URL = os.environ[\"ROTATE_URL\"]\nPROXY_HOST = os.environ[\"PROXY_HOST\"]\nPROXY_PORT = os.environ[\"PROXY_PORT\"]\n\n\ndef rotate_proxy():\n    response = requests.post(ROTATE_URL, timeout=90)\n    response.raise_for_status()\n    result = response.json()\n    if not result.get(\"ok\"):\n        raise RuntimeError(result.get(\"message\", \"proxy rotation failed\"))\n    return result[\"old_ip\"], result[\"new_ip\"]\n\n\ndef new_driver():\n    options = Options()\n    options.add_argument(f\"--proxy-server=http:\/\/{PROXY_HOST}:{PROXY_PORT}\")\n    return webdriver.Chrome(options=options)\n\n\ndriver = None\ntry:\n    for session_number in range(2):\n        if driver is not None:\n            driver.quit()\n            old_ip, new_ip = rotate_proxy()\n            print(f\"Rotated {old_ip} -&gt; {new_ip}\")\n\n        driver = new_driver()\n        driver.get(\"https:\/\/example.com\/\")\n        print(f\"Completed session {session_number + 1}\")\nfinally:\n    if driver is not None:\n        driver.quit()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The exact rotation endpoint and response are described in the <a href=\"https:\/\/proxykite.com\/docs\/api\/rotation\">ProxyKite rotation API reference<\/a>. Keep the rotation URL out of source control and logs. If you use an authenticated proxy, reuse the extension or Selenium Wire setup inside <code>new_driver()<\/code>; rotation changes the mobile exit IP, not the proxy host, port, or authentication format.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Verify the exit IP<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A successful WebDriver navigation proves that Chrome loaded a page. It does not prove that the request left through the intended mobile proxy. Add a small IP-echo check before the real job:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import json\nfrom selenium.webdriver.common.by import By\n\ndriver.get(\"https:\/\/api.ipify.org?format=json\")\nbody = driver.find_element(By.TAG_NAME, \"body\").text\nobserved_ip = json.loads(body)[\"ip\"]\nprint(f\"Browser exit IP: {observed_ip}\")<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After rotation, compare the observed value with the <code>new_ip<\/code> returned by the rotation request. If they differ, allow a short settling period and retry the IP check once before starting the next session. Do not treat a proxy TCP connection as proof of the exit address.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a larger fleet, record the dongle or proxy identifier, session start time, observed exit IP, and rotation result. The <a href=\"https:\/\/proxykite.com\/blog\/how-4g-ip-rotation-works\/\">4G rotating proxy guide<\/a> explains why several browser workers should not share a proxy when they need independent rotation.<\/p>\n\n\n\n<aside class=\"ap-note\"><p>Test one proxy and one browser session first. Keep proxy credentials, API tokens, and rotation URLs out of screenshots, CI logs, shell history, and source control.<\/p><\/aside>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshoot common failures<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Chrome keeps showing a proxy login prompt.<\/strong> Confirm that the endpoint is not in whitelist mode, then use the extension or Selenium Wire path. Do not add the username and password to <code>--proxy-server<\/code> and assume Chrome will parse them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The response is HTTP 407.<\/strong> Check the host, port, scheme, credentials, and public allowlist address. A 407 means the proxy was reached but did not receive acceptable proxy authentication; it is different from a 401 generated by the destination site.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The extension loads but does not answer the challenge.<\/strong> Check that <code>webRequest<\/code> and <code>webRequestAuthProvider<\/code> are both present, that <code>&lt;all_urls&gt;<\/code> is in <code>host_permissions<\/code>, and that the handler uses <code>asyncBlocking<\/code>. Run once without headless mode so Chrome can expose extension errors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The password works in curl but not in Selenium Wire.<\/strong> Percent-encode the username and password with <code>quote(..., safe=\"\")<\/code>, confirm the <code>http<\/code> and <code>https<\/code> entries both point to the upstream proxy, and check inherited <code>HTTP_PROXY<\/code> or <code>HTTPS_PROXY<\/code> variables.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The page loads but the IP is unchanged.<\/strong> The browser may be bypassing the proxy through a <code>NO_PROXY<\/code> rule, or the test URL may be cached. Check the effective Chrome proxy settings and use a fresh IP-echo request with a cache-busting query parameter.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Rotation succeeds but the next session fails.<\/strong> Wait for the rotation request to return <code>ok: true<\/code>, create a new driver, and check the exit IP before the real workflow. Do not rotate repeatedly while the previous rotation is still in progress.<\/p>\n\n\n\n<aside class=\"ap-cta\" aria-label=\"Automate With Your Own Dongles\"><div class=\"ap-cta__content\"><p class=\"ap-cta__eyebrow\">Build Your Proxy Flow<\/p><p class=\"ap-cta__title\">Automate With Your Own Dongles<\/p><p class=\"ap-cta__text\">Use HTTP or SOCKS5 endpoints, rotation controls, and clear credential formats for Selenium jobs.<\/p><\/div><a class=\"ap-cta__btn\" href=\"https:\/\/proxykite.com\/contact\">Contact ProxyKite<\/a><\/aside>\n\n\n\n<h2 class=\"wp-block-heading\">FAQ<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Can Selenium use a proxy with a username and password?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Use an IP whitelist, a Chrome extension that handles <code>onAuthRequired<\/code>, or a forwarding library such as Selenium Wire. Chrome&#8217;s proxy endpoint flag alone is not a complete user:pass authentication mechanism.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why does Chrome return HTTP 407 with my proxy URL?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">HTTP 407 means the proxy was reached but did not accept usable proxy credentials. Check whether the proxy expects user:pass or an allowlisted public IP, then use the client-specific configuration for that mode.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Does Selenium support SOCKS5 proxies?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Chrome can be pointed at an unauthenticated SOCKS5 endpoint with <code>--proxy-server=socks5:\/\/host:port<\/code>. For SOCKS5 user:pass authentication, use a client layer that supports credentials in the SOCKS5 URL, such as the Selenium Wire configuration shown above.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I rotate a proxy IP between Selenium sessions?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Quit the current driver, call the rotation link or authorised rotation API, check the successful response, and create a new driver. Verify the new exit IP before beginning the next browser workflow.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Where should Selenium proxy credentials be stored?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use environment variables, a CI secret, or a secret manager. Avoid putting credentials in command-line arguments, Git, screenshots, browser profiles, or verbose logs because those locations can expose them to other users or services.<\/p>\n\n\n\n<script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"Can Selenium use a proxy with a username and password?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Yes. Use an IP whitelist, a Chrome extension that handles onAuthRequired, or a forwarding library such as Selenium Wire. Chrome's proxy endpoint flag alone is not a complete user:pass authentication mechanism.\"}}, {\"@type\": \"Question\", \"name\": \"Why does Chrome return HTTP 407 with my proxy URL?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"HTTP 407 means the proxy was reached but did not accept usable proxy credentials. Check whether the proxy expects user:pass or an allowlisted public IP, then use the client-specific configuration for that mode.\"}}, {\"@type\": \"Question\", \"name\": \"Does Selenium support SOCKS5 proxies?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Chrome can be pointed at an unauthenticated SOCKS5 endpoint with --proxy-server=socks5:\/\/host:port. For SOCKS5 user:pass authentication, use a client layer that supports credentials in the SOCKS5 URL, such as the Selenium Wire configuration shown above.\"}}, {\"@type\": \"Question\", \"name\": \"How do I rotate a proxy IP between Selenium sessions?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Quit the current driver, call the rotation link or authorised rotation API, check the successful response, and create a new driver. Verify the new exit IP before beginning the next browser workflow.\"}}, {\"@type\": \"Question\", \"name\": \"Where should Selenium proxy credentials be stored?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Use environment variables, a CI secret, or a secret manager. Avoid putting credentials in command-line arguments, Git, screenshots, browser profiles, or verbose logs because those locations can expose them to other users or services.\"}}]}<\/script>\n\n","protected":false},"excerpt":{"rendered":"Learn how to configure a selenium proxy in Python with IP allowlisting, Chrome extension authentication, Selenium Wire, SOCKS5, rotation, and IP checks.","protected":false},"author":1,"featured_media":290,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"csco_singular_sidebar":"","csco_page_header_type":"","csco_page_load_nextpost":"","footnotes":""},"categories":[5],"tags":[215,82,213,214,135],"class_list":["post-289","post","type-post","status-publish","format-standard","has-post-thumbnail","category-use-cases","tag-chrome-automation","tag-proxy-authentication","tag-python","tag-selenium-proxy","tag-socks5","cs-entry"],"_links":{"self":[{"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/posts\/289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/comments?post=289"}],"version-history":[{"count":1,"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/posts\/289\/revisions"}],"predecessor-version":[{"id":522,"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/posts\/289\/revisions\/522"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/media\/290"}],"wp:attachment":[{"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/media?parent=289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/categories?post=289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/tags?post=289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}