Short answers
What does HTTP 407 mean?
The HTTP status means Proxy Authentication Required. During HTTPS CONNECT, it means the tunnel was refused before the destination request could be sent through it. Portproof also documents 407 for an exhausted balance, so the gateway error code matters.
Why do credentials work in curl but not in Playwright?
The clients may use different settings. In Playwright, put the server, username and password in the proxy object. httpCredentials authenticates a website, not the proxy. Repeat a page navigation from the intended browser context.
Should I encode my proxy password?
Encode the username and password components once when building a proxy URL. Do not encode the full URL. When entering the password at curl’s interactive prompt, enter the actual password rather than a URL-encoded value.
Can a 407 mean that my GB ran out?
Yes. The documented quota_reached code indicates exhausted or expired traffic. Check the account balance and validity before regenerating credentials. auth_failed instead points to the username base or password.
What does “CONNECT tunnel failed, response 407” mean?
curl asked the HTTP proxy to open a tunnel for an HTTPS URL and the proxy answered 407 instead of 200. No request reached the destination. Check the proxy username, password and balance; the destination’s own login is not involved.
What is proxy authentication?
It is the sign-in between your client and the proxy server. The proxy sends a Proxy-Authenticate challenge with the 407, and the client answers with a Proxy-Authorization header. It is separate from any login on the website you visit.
Will Python Requests return response.status_code 407?
A plain HTTP request through a proxy can receive a 407 response. A refused CONNECT for an HTTPS destination instead raises ProxyError before a destination response exists. Checking only response.status_code misses that failure.
401 vs 407: which server is asking
RFC 9110 defines the 407 status code as similar to 401 Unauthorized, except that the client must authenticate itself to use the proxy for that request. The two codes use different headers and expect different credentials.
| Aspect | 401 Unauthorized | 407 Proxy Authentication Required |
|---|---|---|
| Who answers | The origin server: the website or API you requested | The proxy between your client and the site |
| Challenge header in the response | WWW-Authenticate | Proxy-Authenticate |
| Credentials header the client sends back | Authorization | Proxy-Authorization |
| How far the headers travel | End to end: a proxy must not change them | Hop by hop: meant only for the next client or proxy in the chain |
| Credentials that fix it | Your account on that site or API | The proxy username and password |
| RFC 9110 sections | 15.5.2, 11.6.1 and 11.6.2 | 15.5.8, 11.7.1 and 11.7.2 |
A 401 comes from the site after the proxy has passed the request on, so changing the proxy password will not fix it. A 407 means the request stopped at the proxy, and the site’s own login is not involved yet.
Identify the response that failed
Proxy authentication uses Proxy-Authenticate and Proxy-Authorization; destination authentication uses different headers. For an HTTPS destination, the client first asks the HTTP gateway to open a CONNECT tunnel. If that stage is refused, changing the destination’s login cannot repair it. See the HTTP 407 definition.
Keep the CONNECT status separate from the destination status. In the check below, connect=407 target=000 means no destination HTTP response was received. The value 000 is curl’s missing-status marker, not an HTTP status sent by a server. For other tunnel failures, use the CONNECT troubleshooting guide.
If a browser or device asks for a username and password without showing an HTTP status, start with the proxy sign-in prompt guide. It helps identify the network setting and the credentials that prompt expects. For a different message, use the proxy error index.
CONNECT tunnel failed, response 407
curl prints curl: (56) CONNECT tunnel failed, response 407 when an HTTPS request through an HTTP proxy is refused at the authentication stage; curl 8.20.0 and later use exit code 7 for the same message, and releases before 7.87.0 printed Received HTTP code 407 from proxy after CONNECT. Chrome and Edge show a sign-in dialog for the same response, Firefox asks with a moz-proxy:// address, and Java clients report Unable to tunnel through proxy with the 407 status line.
Whatever the wording, the failing hop is the proxy. Work through the checks below. If a browser prompt is the only symptom, the username and password prompt guide covers each browser and system. If the CONNECT status is 403, 502 or 503 rather than 407, the CONNECT tunnel guide applies; if there is no status at all, start with connection refused and timeouts or, in Chrome, ERR_PROXY_CONNECTION_FAILED.
Five checks before changing a password
- Read the balance and error code. quota_reached needs a balance or validity check; repeating the same password will not fix it.
- Compare the complete generated username and current proxy password with the connection builder. Your website password and API key are different credentials.
- Check the HTTP or SOCKS5 scheme and matching port. A protocol mismatch may fail before authentication; it is not evidence of a bad password.
- Check how your client receives credentials. URL components need encoding; separate authentication fields and the interactive curl prompt need the original values.
- Check the running worker. A process can retain an older secret after it changes in the dashboard or deployment configuration. Refresh that worker before testing again.
A malformed username is documented as 400 bad_username, not as a 407. Some clients group different connection failures under a proxy error. Keep the exact status or exception class rather than guessing from a generic message.
Check the generated username
Use the builder output as the starting point. It includes the account prefix, pool, country and selected rotation settings. Keep the pool and country unchanged if they remain available. Check current availability on locations.
- Check the full account prefix and the current proxy password together.
- Keep username tokens lower case and preserve their generated order.
- For a sticky session, use an accepted session name and the same generated username throughout the job.
- Check for accidental spaces or line breaks from copying; do not alter whitespace that belongs to the password.
The setup reference documents the fields. The rotation guide explains session lifetime and why a retained device can still change its IP.
Repeat one controlled client check
In an interactive terminal, replace the example username with the complete one from the builder. Enter the password when curl asks; leave it out of the command and proxy URL. This records the two response stages without printing the response body.
curl --disable --silent --show-error --noproxy '' --connect-timeout 5 --max-time 15 -o /dev/null -w 'connect=%{http_connect} target=%{response_code}\n' \
-x "http://gw.portproof.org:7000" \
--proxy-user "USERNAME-mbl-us-rot-auto10" \
https://api.portproof.org/v1/echo-ipA local check with curl 8.7.1 recorded connect=407 target=000 and exit 56 for rejected HTTPS tunnel authentication. The plain HTTP check returned 407 with exit 0 because no HTTP-failure option was set. Neither exit 0 nor receiving a body proves success. These were synthetic loopback checks, not a live-pool benchmark.
Our Requests 2.34.2 fixture likewise recorded a 407 response for rejected plain HTTP proxy authentication, but ProxyError for rejected HTTPS CONNECT. The Python Requests example handles exceptions and encodes credentials once. Adding only if response.status_code == 407 misses a failed tunnel.
Use the complete Node.js fetch, HTTPX or Playwright example for those clients. Each configures its own transport. A passing curl request does not prove that an application follows the same route.
Use the gateway code to choose the next step
| Status and code | Next step |
|---|---|
| 407 · auth_failed | Check the complete username and current proxy password. |
| 407 · quota_reached | Check remaining traffic and validity; changing the password does not restore GB. |
| 400 · bad_username | Rebuild the username and check accepted tokens. |
| 429 · too_many_connections | Reduce concurrent connections and delay any permitted retry. |
| 429 · too_many_sessions | Review named sessions and reuse the intended session within one job. |
| 502 · no_exit_available | Check current availability for that pool and country. |
A client may expose only the tunnel status, without the gateway’s detailed code. Check balance and configuration separately when that happens; status alone cannot distinguish every cause. Checks consume traffic, so keep the endpoint small and avoid an automatic retry loop.
Replace a password deliberately
Regenerate an exposed password, rather than treating every 407 as a reason to replace it. Password changes have no fixed cache propagation or tunnel termination deadline. Arrange the rollout, refresh each worker’s secret and check one request before resuming the queue; do not assume every worker or open tunnel has switched.
Regeneration leaves the username and balance unchanged. The API reference covers the operation. Keep credential-bearing responses and traces out of shared logs. If the refreshed credential is still rejected, stop and investigate rather than regenerating it repeatedly.
Keep the evidence needed for support
- Record the time and time zone, client version, protocol and failing stage.
- Keep the gateway code when available, CONNECT status and destination status separately.
- Describe pool, country and rotation settings without sending the password, API key or credential URL.
After the echo check succeeds, test one authorised application request and its expected content before restarting the workload. See pricing and traffic accounting if the balance was exhausted.
What is not allowed
Use these checks for your own services or permitted QA, price monitoring, ad verification and research. Respect access rules and rate limits. A proxy credential does not grant permission to access a website. See the acceptable-use policy.
Read next
The proxy requires a username and password
Identify the proxy asking for credentials, fix the prompt in each browser and system, and separate gateway sign-in from other passwords.
Read the guide
Fix CONNECT tunnel failed: 403, 407, 502, 503
Read the proxy and destination statuses separately, then choose the next check for 403, 407, 502 or 503.
Read the guide
More in Connect and debug
- ERR_TUNNEL_CONNECTION_FAILED in Chrome and Edge
- Docker proxy: pull, build and container settings
- Proxy format: URL, list formats and ports
- Git proxy: git config http.proxy and checks
- HTTP 429: rate limits and careful retries
- Fix proxy certificate errors in curl
Show 25 more
- pip proxy setup and connection checks
- npm CLI proxy setup and connection checks
- PHP cURL proxy setup and authentication
- Python urllib proxy setup and authentication
- Firefox proxy settings and authentication
- PowerShell proxy setup and authentication
- Puppeteer proxy setup and authentication
- Proxy settings: what they mean and how to check
- Fix ERR_PROXY_CONNECTION_FAILED in Chrome
- Proxy errors: causes and fixes for each message
- Chrome proxy extension: FoxyProxy, ZeroOmega
- Proxy connection refused or timing out
- Wget proxy setup and authentication
- Postman proxy server setup and authentication
- Axios proxy setup for Node.js
- Go HTTP proxy setup with authentication
- Scrapy proxy setup with authentication
- aiohttp proxy setup with authentication
- HTTPX proxy setup for sync and async
- Python Requests proxy setup
- Playwright proxy setup and authentication
- Node.js fetch proxy setup with Undici
- curl proxy: test and use a proxy with curl
- SOCKS5 vs HTTP proxy: which to use
- HTTPS_PROXY not working? Check your client
Buy mobile and residential proxy GB
Choose your GB or reserve a mobile device.