Skip to main content
HTTP/4xx (Client Error)

407 Proxy Authentication Required

The client must first authenticate itself with the proxy.

❓ Why does this happen?

Corporate HTTP proxies require credentials (Proxy-Authorization header) before allowing outbound traffic, breaking npm, git, or Docker pulls.

✅ How to fix it

Configure proxy credentials: npm config set proxy http://user:pass@proxy:8080 or export HTTPS_PROXY with credentials.

Return or handle 407 in your stack

// app/api/resource/route.ts
export function GET() {
  return Response.json(
    { error: "Proxy Authentication Required", status: 407 },
    {
      status: 407
    }
  );
}

Live 407 mock endpoint

Point your app, tests, or retry logic at this free public URL to reproduce a real 407 response (CORS enabled, optional ?delay=ms up to 5000).

https://castov.com/api/mock/407

407 vs similar status codes

Frequently Asked Questions

What does HTTP Status 407 mean?
The client must first authenticate itself with the proxy.
Why am I getting a 407 status code?
Corporate HTTP proxies require credentials (Proxy-Authorization header) before allowing outbound traffic, breaking npm, git, or Docker pulls.
How do I fix a 407 Proxy Authentication Required error?
Configure proxy credentials: npm config set proxy http://user:pass@proxy:8080 or export HTTPS_PROXY with credentials.
What is the difference between 407 Proxy Authentication Required and 401 Unauthorized?
407 asks for credentials for an intermediate proxy (Proxy-Authorization); 401 asks for credentials for the origin server (Authorization).
How can I test how my app handles a 407 response?
Send a request to https://castov.com/api/mock/407 — it returns a real 407 Proxy Authentication Required response with CORS enabled. Add ?delay=2000 to simulate a slow server.

Other 4xx status codes

Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.