Skip to content

Proxy errors

407 Proxy Authentication Required

The proxy is reachable and refused your credentials. In most cases the wrong secret was used, a special character was not encoded, or the rental has ended.

A 407 means the proxy received your request and rejected the username or password. The network path is fine; the credentials are not.

Error
407 Proxy Authentication Required
Comes from
The proxy

What a 407 actually tells you

HTTP 407 is the proxy equivalent of 401. The difference matters: a 401 comes from the website you are trying to reach, while a 407 comes from the proxy sitting in front of it. Your request never got as far as the target site.

That is useful, because it rules out a whole class of problems. The hostname resolved, the TCP connection opened, and the proxy answered you. Firewalls, DNS and routing are all working. What failed is the Proxy-Authorization header: either it was missing, or the username and password in it were not accepted.

A 407 is also distinct from a connection that simply hangs or is refused. If you see 407, something on the other end is alive and talking to you.

The five causes, in the order we actually find them

Across support tickets, almost every 407 turns out to be one of these. They are listed by how often they are the answer, not by how obvious they are.

  1. The API key was used instead of the proxy password. These are different secrets. An API key authenticates calls to the account API over HTTPS. The proxy wants the username and password shown on the order.
  2. The password contains a character that breaks the URL. An @, : or # inside a proxy URL is parsed as structure, not as part of the password. Encode them as %40, %3A and %23, or pass the credentials separately instead of inlining them.
  3. A trailing space or newline was copied with the password. This is invisible in most editors and very common when copying from a web page. Retyping the password by hand rules it out in a few seconds.
  4. The rental period ended. An expired proxy does not usually announce that it has expired. It stops accepting the credentials, which surfaces as a 407.
  5. The credentials were rotated after you copied them. Regenerating a proxy password invalidates the previous pair immediately.

Isolate it with one command

Before changing anything in your application, test the credentials on their own. This separates a credential problem from a problem in your HTTP client, your framework or your proxy manager.

Using --proxy-user rather than inlining the password in the URL is deliberate. It hands the credentials to curl as separate values, so any special character in the password is handled for you and cause two above disappears from the list.

curl -v --proxy proxy.example.com:8000 \
  --proxy-user 'USERNAME:PASSWORD' \
  https://icanhazip.com

Reading the result

If that command prints an IP address, the credentials are correct and the fault is in how your application passes them. Look at how your HTTP library builds the proxy URL, and whether it is encoding the password for you or expecting you to do it.

If it still returns 407, the credentials themselves are being refused. Check the rental has not expired, then regenerate the password and try the new pair. If a freshly generated password is also refused, the account or the proxy has been suspended and support needs to look at it.

One detail worth knowing: with -v, curl shows the Proxy-Authorization header being sent. If that header is absent entirely, your client is not applying the credentials at all, which is a configuration problem rather than a wrong password.

Language-specific traps

In Python, requests takes the credentials inside the proxy URL, so an unencoded special character silently produces a malformed URL. Use urllib.parse.quote on the password before building the string.

In Node.js, undici and node-fetch differ in how they accept proxy credentials, and several older libraries ignore the auth portion of a proxy URL entirely. If the header is missing in a verbose trace, that is usually why.

Browser-level proxy extensions often store credentials separately from the host and port, and silently keep an old password after you change it in the extension's settings. Removing and re-adding the profile is faster than debugging it.

Frequently asked questions

Is 407 a problem with my network?

No. A 407 means the proxy answered you, so the connection worked. Only the credentials were rejected.

Can I use my API key as the proxy password?

No. The API key is for the account API over HTTPS. The proxy uses the username and password from the order.

Why did it work yesterday and not today?

The two usual reasons are that the rental period ended, or the password was regenerated after you copied it.

Does a 407 use up bandwidth?

Almost none. The request is rejected at the proxy before it reaches the target site.

Ready to try it?

Create an account, add funds from US$1 and pick your country and proxy type.