NEWStandard createTask and in.php APIs. Change the address and you are connected.View API docs
GATESOLVER

Proxies and networking

How does proxy authentication work?

A proxy either asks for a username and password with each connection, or it trusts a list of client IP addresses you registered in advance.

Two methods

Commercial and private proxies use one of two ways to decide who may connect. With username and password, your client sends credentials to the proxy, usually in a Proxy-Authorization header using the Basic scheme. With an IP allowlist, you register your server's public IP with the provider, and any connection from that address is accepted with no credentials. Many providers support both; you pick per use case.

How credentials travel

For HTTP proxies, the client sends Proxy-Authorization: Basic followed by base64 of user:password. Base64 is encoding, not encryption, so the credentials are only protected if the connection to the proxy is encrypted or private. For HTTPS targets, the client first sends a CONNECT request with that header, and the proxy opens a tunnel; after that, the traffic to the site is encrypted end to end and the proxy cannot read it. For SOCKS5, the username and password exchange is part of the SOCKS handshake instead of an HTTP header.

# what the client sends to the proxy before an HTTPS request
CONNECT shop.example.com:443 HTTP/1.1
Host: shop.example.com:443
Proxy-Authorization: Basic c2NyYXBlcjpzM2NyZXQ=

In practice: the URL form

Most libraries accept credentials embedded in the proxy URL and build the header for you:

import requests

relay = "http://scraper:s3cret@203.0.113.40:3128"
r = requests.get("https://echo.example.net/ip", proxies={"http": relay, "https": relay}, timeout=20)
print(r.json())

If the password contains @, : or /, percent-encode it (@ becomes %40), or the URL will be parsed wrongly. The same URL form is what a CAPTCHA task expects in its proxy field; see proxy format for tasks.

Choosing between the methods

Username and passwordIP allowlist
Works from any machineYesOnly registered IPs
Secret to protectYes, the passwordNo
Works in tools without auth supportNoYes
Usable by a remote solverYesOnly if its IP is allowlisted

That last row matters for CAPTCHA tasks that run through your proxy. The solver connects from its own addresses, so an allowlist that only contains your server's IP will refuse it. Use credentials for proxies you pass in tasks.

Extra options in the username

Many providers encode settings in the username, such as country, city or a session id that keeps the same exit IP: something like user-country-de-session-81f2. The proxy reads the string and routes accordingly. The syntax is provider specific, so check your provider's documentation; the concept is covered under sticky sessions and geotargeting.

Errors you will meet

  • 407 Proxy Authentication Required: missing or wrong credentials, or an allowlist that does not include your IP. The page on fixing 407 walks through it.
  • Connection refused or reset: wrong port, or the proxy closes connections from unknown IPs without a reply.
  • 403 from the proxy itself: the account is out of traffic or blocked from that target.

Keeping credentials safe

Store proxy credentials in environment variables or a secrets file, not in code you commit. Use separate proxy users for separate projects so a leak affects only one, and rotate passwords when someone leaves the team. Avoid printing full proxy URLs in logs; mask the password part.

Testing authentication on its own

Before you plug a proxy into a scraper or a task, test the login step alone. A single curl call with -x http://user:pass@host:port against an IP echo page tells you three things at once: the credentials are accepted, the port is right, and the exit IP is the one you expect. If curl gets a 407, the problem is the credentials or the allowlist, not your scraper. If curl works and your code does not, compare how each passes the proxy; a missing scheme such as http:// at the start of the URL is a frequent culprit. The checklist on testing a proxy covers speed and reputation checks as well.

Common questions

Is proxy Basic authentication secure?

Base64 is only encoding. It is safe when the link to the proxy is private or encrypted, and the target traffic stays encrypted inside CONNECT tunnels.

Can I use an IP allowlisted proxy in a solving task?

Only if the solver's IPs are on the list, which is rarely practical. Use a username and password instead.

How do I put a password with @ in the URL?

Percent-encode it: @ becomes %40, : becomes %3A and / becomes %2F.

Does the proxy see my HTTPS data?

No. With CONNECT the proxy only sees the host and port; the content is encrypted between you and the site.

Why does my proxy work in curl but not in my browser automation?

Some browser launch options do not accept credentials in the URL; use the tool's separate proxy username and password settings.

Keep reading