Skip to content
Get Started
G2G2
4.7/5
Excellent
Trustpilot

What Is 407 Proxy Authentication Required?

407 Proxy Authentication Required is the HTTP status code a proxy server returns when a request reaches it without valid credentials. The proxy has not contacted the website at all; it is asking the client to authenticate first.

  • Session Control
  • High Speed
  • Privacy First
Best fit for 407 Proxy Authentication RequiredStatic ISP Proxiesfrom$0.75/IP
how it works

How a 407 response works

The status is defined in section 15.5.8 of RFC 9110. It works like 401 Unauthorized, but for the proxy rather than the website. The response must include a Proxy-Authenticate header naming the scheme the proxy accepts, for example Proxy-Authenticate: Basic realm="proxy", and the client is expected to retry with a matching Proxy-Authorization header.

For https:// sites the 407 is the answer to the CONNECT request, before any TLS starts. Clients report it differently: curl shows the status in verbose mode, and Python requests raises a ProxyError that mentions 407.

why it matters

Why a 407 matters for proxy users: common causes

A 407 means none of your requests reached the target, so it is never a block by the website and never an IP reputation problem. Fix the authentication and the requests go through. The usual causes:

407 Proxy Authentication Required: what it means for you
  • Wrong or missing credentials: a typo, a password copied with a trailing space, or a proxy URL with no USERNAME:PASSWORD@ part.
  • Special characters not URL-encoded. In a proxy URL, @, :, #, / and % inside the username or password break parsing, so p@ss must be written p%40ss.
  • Whitelist mismatch. With IP whitelisting the proxy checks the IP you connect from. A new home IP, a VPN or a cloud server leaving from an unregistered address all get 407; check yours with what is my IP.
  • Wrong scheme or entry. The proxy may accept only Basic while the client offers another scheme, or in Python requests the credentials sit on the http key but not on the https key.
  • Plan status. Some providers also answer 407 when a plan has expired or run out of data.
try it

Fix a 407 with curl

Pass the credentials with -U (--proxy-user) so curl does not have to parse them out of the URL, and add -v to see the proxy's reply. Single quotes stop the shell from changing characters such as $ and \.

If an IP address prints, authentication works and the problem is in your application's proxy settings.

Test proxy credentials with curlShell
curl -v -x http://HOST:PORT -U 'USERNAME:PASSWORD' https://api.ipify.org
try it

Fix a 407 in Python requests

Encode the username and password with quote(..., safe=""), which escapes every reserved character, and put the same URL on both keys so https:// requests are authenticated too.

CleanProxies static ISP proxies accept username:password or up to 20 whitelisted IPv4 addresses, and the proxy errors guide covers the other status codes you may see.

URL-encoded proxy credentialsPython
from urllib.parse import quote

import requests

user = quote("USERNAME", safe="")
password = quote("PASSWORD", safe="")
proxy = f"http://{user}:{password}@HOST:PORT"
proxies = {"http": proxy, "https": proxy}

r = requests.get("https://api.ipify.org", proxies=proxies, timeout=30)
print(r.status_code, r.text)

Static ISP proxies from $0.75/IP

The CleanProxies proxy that fits best here, with a $4.99 trial to test it first.

Dedicated IPs on US carrier ASNs with unlimited bandwidth and threads, never shared.

starting from$0.75/IP

Dedicated static IPs registered to US and Canadian ISPs. The address stays the same for as long as you hold it, with unlimited bandwidth and HTTP(S) or SOCKS5 access.

Guides from the blog

Setup guides and best practices from the CleanProxies blog.

Get the latest insightsAll Blogs

Related terms

Terms that come up alongside 407 Proxy Authentication Required.

All glossary terms

407 Proxy Authentication Required FAQs

Straight answers about 407 Proxy Authentication Required.

A 401 comes from the website and asks for the site's own login. A 407 comes from the proxy and asks for the proxy credentials, before the request reaches the website.

Got more questions?All FAQs