Tutorials 5 min read

How to Fix Proxy Error 407 (Proxy Authentication Required) in 2026

A 407 almost always comes down to one of eight small mistakes. Here's the checklist we walk through with every ticket, plus the curl commands to find the culprit fast.

Proxy error 407 means the proxy server received your request but refused to forward it because it couldn't authenticate you. The full status line is "407 Proxy Authentication Required", and it comes from the proxy, not from the website you're trying to reach. That's good news: the problem is somewhere between your client and the proxy, which makes it easy to narrow down.

This guide covers what the error means, an eight-point checklist that resolves almost every case, and a few curl commands that tell you exactly which item on the list you're hitting.

What "407 Proxy Authentication Required" Actually Means

HTTP has two similar codes. A 401 comes from the destination website and means you aren't logged in there. A 407 comes from the proxy in the middle and means the proxy needs credentials it didn't get, or got credentials it doesn't accept. Your client is supposed to send a Proxy-Authorization header with a username and password. If that header is missing, malformed or wrong, you get a 407.

On the NodeProxies gateway, a 407 means one of two things: the username or password is wrong, or the plan behind those credentials isn't active. A different code, 402, means the credentials are fine but the plan has run out of bandwidth. If you see 402, there's nothing to debug: top up the plan and the same credentials start working again.

The 407 Checklist

Work through these in order. The first three cause most of the 407 errors we see.

  1. Typos in the username or password. Copy them again from the dashboard rather than retyping. Usernames are easy to mistype when they include targeting options.
  2. Special characters in the password that aren't URL-encoded. In a URL like http://USER:PASS@host:port, the characters @ : / # ? % have special meaning. A password containing @ splits the URL in the wrong place and the proxy receives garbage. Encode them: @ becomes %40, : becomes %3A, # becomes %23, / becomes %2F, % becomes %25.
  3. Options appended to the password instead of the username. Targeting and session options belong in the username: USERNAME-country-us or USERNAME-session-abc123-time-10. If you add -country-us to the password, the password no longer matches and you get a 407.
  4. Wrong host or port. HTTP goes to global.nodeproxies.xyz:8080 and SOCKS5 to global.nodeproxies.xyz:1080. An old hostname from another provider or a leftover port from a previous config is a common cause.
  5. The plan is inactive or expired. Credentials belong to a plan; if the plan isn't active, the gateway answers 407 even with a perfect username and password. Check the plan status in your dashboard.
  6. Invisible whitespace. Copying from a spreadsheet, chat app or PDF often adds a trailing space or newline. Strip your credentials before building the URL, especially when reading them from a file or environment variable.
  7. The client doesn't send credentials for HTTPS. For HTTPS sites, your client opens a CONNECT tunnel and must attach Proxy-Authorization to that CONNECT request. Some clients don't by default. Java is the classic example: since Java 8u111, Basic auth for HTTPS tunnels is disabled unless you set -Djdk.http.auth.tunneling.disabledSchemes="". Browsers launched with only --proxy-server also don't get credentials and need another way to supply them.
  8. SOCKS5 and HTTP mixed up. Sending an http:// proxy URL to the SOCKS5 port, or socks5:// to the HTTP port, produces confusing failures that are easy to mistake for an auth problem. Make sure the scheme matches the port.

If you build usernames by hand, the proxy username builder generates the correct string for country, city and session options, and the proxy format converter in our free tools turns host:port:user:pass lists into the URL format your tool expects.

Diagnose Proxy Error 407 With curl

curl is the fastest way to separate a credentials problem from a problem in your own code. Start with the verbose flag so you can see the proxy's response:

curl -v -x http://global.nodeproxies.xyz:8080 -U "USERNAME:PASSWORD" https://api.ipify.org

Using -U (short for --proxy-user) instead of putting credentials in the URL avoids URL-encoding problems entirely, because curl doesn't parse them as part of a URL. In the output, look for these lines:

  • "CONNECT tunnel failed, response 407" or "HTTP/1.1 407": the gateway rejected the credentials. Re-check the username, password and plan status.
  • "HTTP/1.1 402": the credentials are valid but the plan is out of bandwidth.
  • "HTTP/1.1 200 Connection established" followed by an IP address: the proxy works. If your app still fails, the bug is in how your app passes credentials.
  • "Could not resolve proxy" or "Failed to connect": wrong host or port, or a firewall on your side is blocking outbound connections.

If -U works but the URL form fails, your password needs encoding. You can test the encoded URL form like this:

# password is p@ss:word  ->  p%40ss%3Aword
curl -v -x "http://USERNAME:p%40ss%[email protected]:8080" https://api.ipify.org

To check whether a targeting option is the problem, test the bare username first and add options one at a time:

curl -x http://global.nodeproxies.xyz:8080 -U "USERNAME:PASSWORD" https://api.ipify.org
curl -x http://global.nodeproxies.xyz:8080 -U "USERNAME-country-us:PASSWORD" https://api.ipify.org
curl -x http://global.nodeproxies.xyz:8080 -U "USERNAME-country-us-session-test1-time-10:PASSWORD" https://api.ipify.org

For SOCKS5, test the SOCKS port with the matching scheme:

curl -v -x socks5h://global.nodeproxies.xyz:1080 -U "USERNAME:PASSWORD" https://api.ipify.org

Encoding Credentials in Code

Once curl works, the safest habit is to encode the password in code instead of pasting it into a URL by hand:

# Python
from urllib.parse import quote
proxy = f"http://{user}:{quote(password.strip(), safe='')}@global.nodeproxies.xyz:8080"

// Node.js
const proxy = "http://" + user + ":" + encodeURIComponent(password.trim()) + "@global.nodeproxies.xyz:8080";

The usernames themselves only contain letters, digits and hyphens, so they don't need encoding. Our Node.js guide shows a full working setup, including how to pass credentials to Puppeteer without a URL.

When It's Not a 407 at All

If the proxy connects fine but the website returns 403 or 429, that's the target blocking you, not an authentication issue. Those need a different fix, covered in why proxies get blocked.

Fixing It on NodeProxies

Open the proxy generator in your dashboard, copy a freshly generated proxy string and test it with the first curl command above. If you get a 407 with a generated string, check that the plan is active; if you get a 402, add bandwidth. Plans can be topped up from 100 MB, and your account balance never expires. The connection docs list every username option, and pricing shows the current per-GB rates.

FAQ

Is a 407 error my fault or the proxy provider's?

Almost always it's a configuration issue on the client side: wrong credentials, unencoded special characters or options in the wrong field. Testing the same credentials with curl -U tells you within seconds.

What's the difference between 407 and 401?

A 407 comes from the proxy and means proxy authentication failed. A 401 comes from the destination website and means you need to log in to that site.

Why do I get 407 only on HTTPS sites?

Your client probably isn't sending Proxy-Authorization on the CONNECT request used for HTTPS. Check your library's proxy auth settings; in Java, re-enable Basic auth for tunnels with the jdk.http.auth.tunneling.disabledSchemes property.

What does proxy error 402 mean?

On NodeProxies, 402 means the credentials are valid but the plan has no bandwidth left. Top up the plan and the same proxy string works again.

NodeProxies

Ready to get started?

90M+ residential, mobile & datacenter proxies. Datacenter from $0.30/GB, residential from $0.42/GB. No contracts.

Create free account