A 407 Proxy Authentication Required error, also shown as HTTP error 407, means the proxy server between you and the website won’t pass your request on until you prove who you are. The website never sees the request. Most of the time, the fix is to correct your proxy username and password, authorize your IP address, or make sure your browser or code sends credentials to the proxy.
This guide covers what the error means and how the handshake works, how to find and confirm it, the common causes, step-by-step fixes, 407 vs 401, and examples and related errors.
TL;DR
- A proxy authentication required error comes from the proxy when your credentials are missing or wrong, so the website never receives the request.
- The proxy sends a Proxy-Authenticate header, and your client has to reply with a Proxy-Authorization header.
- The most common causes are wrong or missing credentials, an IP that isn’t authorized, a client that doesn’t send credentials, or an outdated proxy list.
- Check your credentials first, then IP authorization, then browser and extension settings, then system and code settings.
- A 401 comes from the website, while a 407 comes from the proxy.
What Is the 407 Proxy Authentication Required Error?
Status code 407 is an HTTP client error that a proxy server returns when your request doesn’t include valid credentials for that proxy between you and the server hosting the resource, and it won’t forward anything until you authenticate.
With the 407, the proxy sends a Proxy-Authenticate header that says how to authenticate, such as the Basic scheme (username and password). Your client can then retry with a Proxy-Authorization header carrying the correct credentials.
Browsers usually show the error as a sign-in pop-up, while scripts and tools raise an exception or return the 407 status code.
How Does Proxy Authentication Work?
Proxy authentication happens as a short exchange between your client and the proxy, before any traffic reaches the website.
Here’s the sequence:
- Your client sends a request through the proxy.
- The proxy checks the request for credentials. If it finds no valid ones, it returns a 407 with a Proxy-Authenticate header.
- Your client resends the request with a Proxy-Authorization header. With the Basic scheme, this header carries your username and password, Base64-encoded.
- If the proxy accepts the credentials, it forwards the request to the destination server.
The full round trip looks like this:
Client → Proxy (407 + Proxy-Authenticate) → Client retries with Proxy-Authorization → Proxy → Destination serverProxy providers offer two common ways to authenticate. The first is a username and password, which your client sends with every request. The second is IP authorization, where you add your IP address to an approved list, and the proxy accepts any request coming from it without credentials.
On HTTPS sites, your client first sends the proxy a CONNECT request, asking it to open a tunnel to the site. The proxy can reject that request with a 407 before anything else happens, which is why some tools fail on HTTPS pages but load HTTP pages fine.
How to Find the 407 Error (and Confirm It Is a Proxy Problem)
A 407 looks different depending on where it shows up, so start with whichever of these matches your setup.
In a Browser
You’ll see a sign-in pop-up asking for a proxy username and password that keeps coming back, or a page that reads “407 Proxy Authentication Required.” In Chrome, a common reason the prompt keeps returning is that Chrome takes its proxy settings from your operating system, and on Windows those settings have no fields for a proxy username and password.
In cURL
To check from the command line, run a verbose request through the proxy.
curl -v -x http://p.webshare.io:80 https://example.comLook at the first response line, which starts with <. If it shows a 407 followed by a Proxy-Authenticate header, the proxy is rejecting your request.
In Code
In Python’s requests, an HTTPS request fails with a ProxyError that mentions Tunnel connection failed: 407 Proxy Authentication Required. A plain HTTP request comes back as a response with a 407 status code. Python’s urllib raises HTTP Error 407 for plain HTTP requests, and a URLError that mentions Tunnel connection failed: 407 for HTTPS.
In a Proxy Provider Dashboard
Your provider’s activity or error page shows whether your requests are failing. If you use Webshare, the Webshare dashboard shows your proxy list, credentials, and settings, so you can check them against what your client is sending. To rule out your own setup, you can also test the proxy with Webshare’s Proxy Checker.
Common Causes of the 407 Error
Below are the primary causes of a proxy authentication error, sorted into the two groups they fall under.
1. Credential and Authorization Causes
These causes are likely if you’ve just set up the proxy or changed something on your account.
- Your proxy username or password is wrong or mistyped.
- You’re using credentials from a different plan or account, or from an outdated proxy list.
- Your current IP isn’t authorized, or it has changed since you authorized it.
- Your password contains special characters that break the proxy URL because they aren’t URL-encoded.
- Your subscription has expired or been paused, or you’ve used up your bandwidth. Some providers return a 407 for this, though Webshare returns a 402 Payment Required.
2. Client and Configuration Causes
If there are no issues with your credentials or IP authorization, the cause may be from your client or network setup.
- Your browser, app, or script isn’t sending credentials to the proxy at all.
- The proxy host or port is wrong, or an HTTP proxy is set up as a different protocol.
- A VPN, antivirus web filter, or ad blocker is interfering with the proxy connection.
- Your operating system or corporate proxy settings are overriding your browser’s.
- On a corporate network, an expired directory password, an access rule, or a gateway lockout after repeated failed logins is blocking you.
How to Fix the 407 Proxy Authentication Required Error
Follow the steps below to resolve a 407, starting with the most likely cause.
Step 1: Check Your Proxy Credentials
Make sure the username and password your client sends match the ones from your provider. Copy them directly instead of retyping them, watch for trailing spaces, and check that you’re using your proxy credentials and not your account login.
If you use Webshare, your proxy credentials and proxy list are in the Webshare dashboard. On the Proxy List page, the Authentication Method drop-down above the list, next to Connection Method, lets you choose between Username/Password and IP Authentication.
Step 2: Check IP Authorization
If your provider uses IP authorization, confirm that your current public IP matches the one you authorized. Home networks and cloud instances can change IPs without warning.
In Webshare, open Proxy Settings, go to IP Authorizations, and click Add New IP Address. Enter your IP and click Save. Your current IP appears above the list, so you can compare it with the authorized one.
Each account gets one authorized IP by default; an authorized IP works for one plan at a time, and authorizing the same IP on another account moves it there.
Step 3: Check Browser and Extension Settings
Confirm that the proxy host and port in your browser or system proxy settings match your provider’s details.
Chrome uses your operating system’s proxy settings. On Windows, those settings have no fields for a proxy username and password. If the sign-in prompt keeps coming back, use a proxy extension that handles authentication instead. The Webshare Chrome proxy extension works with your Webshare proxy list, so once you log in, you can connect to any proxy from that list.
In Firefox, the sign-in dialog is titled Authentication Required and names the proxy with a moz-proxy:// address. Enter your proxy credentials there. If the dialog keeps reappearing, check the proxy setup in Firefox’s connection settings.
On Windows, a proxy sign-in pop-up that keeps coming back often points to an old proxy address or outdated saved credentials. Check the proxy address and port in Settings > Network & Internet > Proxy. Then open Credential Manager, select Windows Credentials, and remove any saved entries for your proxy before you sign in again.
If the proxy authentication error still won’t clear, temporarily disable your VPN, antivirus web filtering, and ad blockers, then retest. After that, clear your cookies and restart the browser.
Step 4: Check Your Code or Tool
Make sure your script or tool sends credentials to the proxy on every request. These examples use Webshare’s Backbone Connection endpoint, p.webshare.io on port 80, so swap in the USERNAME and PASSWORD shown when Connection Method is set to Backbone Connection. The Direct Connection view lists credentials in a different format that won’t work on p.webshare.io.
In Python’s requests, set the proxy for both the http and https keys.
import requests
proxy = "http://USERNAME:PASSWORD@p.webshare.io:80"
proxies = {"http": proxy, "https": proxy}
r = requests.get("https://example.com", proxies=proxies, timeout=30)
print(r.status_code)In Python’s urllib, pass the same proxy URL to a ProxyHandler for both schemes. urllib reads the credentials from the URL and sends them to the proxy for you.
import urllib.request
proxy = "http://USERNAME:PASSWORD@p.webshare.io:80"
handler = urllib.request.ProxyHandler({"http": proxy, "https": proxy})
opener = urllib.request.build_opener(handler)
with opener.open("https://example.com", timeout=30) as r:
print(r.status)For a quick test with cURL, pass your credentials with the -U flag.
curl -x http://p.webshare.io:80 -U USERNAME:PASSWORD https://example.comURL-encode any special characters in your username or password (@ becomes %40, # becomes %23). Depending on the tool, an unencoded character either garbles the credentials, which returns a 407, or stops the proxy URL from parsing at all. If the same proxy works in cURL but fails in your tool, the tool isn’t sending credentials correctly.
The Backbone Connection endpoint stays the same when your proxy list is refreshed or replaced, which avoids the outdated-list cause. On Direct Connection, use the proxy IP and port from your own proxy list instead. If your network blocks port 80, you can use port 1080, 3128, or any port from 9999 to 29999.
Step 5: Check Your Provider Account and Proxy List
Confirm that your plan is active and has bandwidth left. On Webshare, a lapsed plan or used-up bandwidth shows as a 402 rather than a 407. If your tool uses a saved copy of your proxy list, re-download or refresh it.
With Webshare, connecting to a proxy that’s no longer on your list, such as after a refresh or replacement, returns a no_proxies_allocated 407. Switch to Backbone Connection (p.webshare.io) or update the proxy list in your tool.
Step 6: Corporate and System Proxies
On a managed network, check whether a recent password change or account lockout triggered the 407. Your network administrator issues the proxy credentials, so ask them to check the gateway logs and confirm the correct authentication scheme.
Corporate proxies often use NTLM or Negotiate (Kerberos) instead of Basic authentication. Some tools and libraries only support Basic, so a 407 that persists with the right credentials can mean your tool doesn’t support the proxy’s scheme. The Proxy-Authenticate header in the 407 response names the scheme the proxy expects.
Explore Webshare Proxy Servers →
407 vs 401: What’s the Difference?
Both codes ask for credentials, but they come from different places and need different fixes. Both are defined in RFC 9110, the HTTP semantics standard.
A 403 Forbidden is a different problem. It means the server understood your request and refuses to fulfill it, so authenticating again won’t change the result.
Examples of the 407 Error
The two examples below show what a 407 looks like in a raw request and response, and in a few common real-world scenarios.
Example 1: Raw Request and Response
When a proxy rejects your request, its response starts with these two lines.
HTTP/1.1 407 Proxy Authentication Required
Proxy-Authenticate: Basic realm="Access to the proxy"The first line is the status line, which tells you the proxy refused the request because it needs authentication. The second line is the challenge, which says the proxy expects Basic authentication and names the protected area, known as the realm.
Your client then retries with a Proxy-Authorization header. This header holds your username and password, joined by a colon and Base64-encoded.
GET http://example.com/ HTTP/1.1
Host: example.com
Proxy-Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=Example 2: Common Real-World Scenarios
Here are some ways that a 407 can show up:
- A script works on your laptop but returns a 407 on a cloud server because the server’s IP isn’t authorized with your proxy provider.
- Chrome shows a sign-in pop-up that keeps coming back because your proxy credentials aren’t saved anywhere Chrome can use.
- A Python script fails only on HTTPS URLs because the https key in the proxies dictionary points to the proxy without credentials, while the http key includes them.
Related Errors to Look For
Here are other errors that, though easy to confuse with status code 407, have different causes and fixes:
- 401 Unauthorized: The website needs you to authenticate, and the proxy has nothing to do with it.
- 403 Forbidden: Access is refused, and authenticating again won’t change that.
- 429 Too Many Requests: The destination is rate-limiting your requests.
- 502 Bad Gateway and 504 Gateway Timeout: The proxy couldn’t get a valid or timely response from the upstream server.
- 511 Network Authentication Required: The network itself, such as a captive portal, needs you to log in.
- A refused or timed-out connection: Points to a wrong host or port, or a proxy you can’t reach.




