407 Proxy Authentication Required
A proxy between you and the website needs you to authenticate before it will forward your request.
What 407 Proxy Authentication Required means
407 is like 401, but for a proxy. The proxy sends a Proxy-Authenticate header with the scheme it wants, and the client answers with Proxy-Authorization.
You usually see it on corporate networks, or when a tool such as npm, git or Docker is set to use a proxy that needs a login.
Common causes
- A company proxy that requires a username and password.
- Missing or wrong credentials in HTTP_PROXY or HTTPS_PROXY variables or in a tool's proxy settings.
How to fix 407 Proxy Authentication Required
- Sign in to the proxy, or ask your network admin for the right credentials.
- Put the credentials in the proxy URL (http://user:pass@proxy:port), URL-encoding any special characters.
- If you should not be using a proxy at all, remove it from system and tool settings.
Headers that go with it
Proxy-AuthenticateProxy-Authorization
Example response
HTTP/1.1 407 Proxy Authentication Required
Proxy-Authenticate: Basic realm="proxy"
Content-Type: text/plain; charset=utf-8
407 Proxy Authentication RequiredHow to check for a 407 response
cURL
# Print only the status code
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/JavaScript (Node.js)
const res = await fetch("https://example.com/");
if (res.status === 407) {
console.log(res.status, res.statusText);
}Python
import requests
res = requests.get("https://example.com/")
if res.status_code == 407:
print(res.status_code, res.reason)Go
res, err := http.Get("https://example.com/")
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
if res.StatusCode == 407 {
fmt.Println(res.Status)
}Specification
407 Proxy Authentication Required is defined in RFC 9110, section 15.5.8.
Related status codes
- 401
The request needs authentication. You are not logged in, or the credentials or token you sent are missing, invalid or expired.
- 403
The server understood the request but refuses to allow it. Logging in again will not help unless your account gets access.
- 511
Network Authentication Required
You need to log in to the network before you can get online, typically on hotel, airport or cafe Wi-Fi with a captive portal.