Set up proxy authentication with ProxyField
- Copy the username and password from your ProxyField account.
- Add the location and session to the username, as in
<login>-country-us-city-new_york. - Enter both in the tool's proxy login fields, or in the URL
http://<username>:<password>@gate.proxyfield.io:7000, percent-encoding@,:and/in the password. - For a tool with no login fields, add the machine's public IP to the allowlist and use the port you set up in the dashboard.
- Send one request to
https://api.ipify.orgthrough the proxy and check that the IP is not yours.
One request with the login in curl's -U option:
curl -x gate.proxyfield.io:7000 -U "<login>-country-us-city-new_york:<password>" https://api.ipify.orgHow Proxy-Authenticate and Proxy-Authorization work in general: HTTP authentication (MDN).
On this page 10 sections
Username and password vs IP whitelist
| Feature | Username and password | IP whitelist (allowlist) |
|---|---|---|
| How the proxy knows you | the credentials sent with the connection | the public IP the connection comes from |
| Works from | any network, any device | only the IPs you registered |
| When your IP changes | nothing breaks | you must update the list |
| Credentials in your tools | yes, in each proxy setting or script | none |
| Targeting in the login | yes, in the username (for example country and city) | with the allowlist, the product, location and session are set per port in the dashboard |
| Tools without login fields | not possible (Windows system proxy, some browser setups) | works |
| Typical fit | laptops, phones, scripts that move between networks | servers with a fixed IP, office networks, tools that can't send a login |
ProxyField supports both: a username and password on gate.proxyfield.io:7000, and the allowlist on the port you set up in the dashboard. Credentials and the allowlist are in your account once the payment is confirmed. The allowlist takes up to 100 IPv4 addresses per account, and one address can be on one account only.
How username and password authentication works
For an HTTP or HTTPS proxy, the login travels in an HTTP header:
- Your client sends a request to the proxy without credentials.
- The proxy answers
407 Proxy Authentication Requiredwith aProxy-Authenticateheader naming the scheme it accepts, usuallyBasic. - The client repeats the request with
Proxy-Authorization: Basic <base64 of user:password>. - The proxy checks it and forwards the request. Many clients send the header on the first request and skip the 407 round trip.
The headers are defined in HTTP Semantics (RFC 9110, sections 11.7.1 and 11.7.2) and the Basic scheme in RFC 7617. Base64 is an encoding, not encryption: anyone who can read the connection between you and the proxy can read the password. For HTTPS sites the client sends the header with its CONNECT request, before the encrypted tunnel to the site starts. The website never receives your proxy credentials; the proxy consumes them.
Most tools take the login in a proxy URL or in separate fields:
curl -x http://gate.proxyfield.io:7000 -U "<login>-country-us-city-new_york:<password>" https://api.ipify.org
curl -x "http://<login>-country-us-city-new_york:<password>@gate.proxyfield.io:7000" https://api.ipify.orgWith ProxyField, the username also carries the targeting: <login>-country-us-city-new_york asks for a New York exit IP. Region, session and session time go in the same username: -region-<region>, -session-<id> and -ttl-<seconds> (30 to 129,600 seconds, 20 minutes by default), as in <login>-country-us-region-new_york-city-new_york-session-he9f2qga-ttl-600; every part after the login is optional.
How SOCKS5 authentication works
SOCKS5 negotiates the login inside its own handshake rather than in HTTP headers (RFC 1928):
- The client opens a TCP connection and lists the methods it supports:
0x00(no authentication) and0x02(username/password). - The server picks one. A proxy that requires a login picks
0x02. - The client sends the username and password, each up to 255 bytes, as defined in RFC 1929.
- The server replies with success or failure; on failure it closes the connection.
The RFC 1929 exchange is plain text, like HTTP Basic. Not every client implements it: Chrome supports no authentication method for SOCKS5 (Chromium: proxy support in Chrome), so in Chrome use an HTTP proxy, an extension, or an IP allowlist. In curl, socks5h:// also resolves the site's hostname at the proxy. ProxyField's gateway takes the SOCKS5 login on the same host and port as HTTP:
curl -x "socks5h://<login>-country-us-city-new_york:<password>@gate.proxyfield.io:7000" https://api.ipify.orgSOCKS5 runs on the same gate.proxyfield.io:7000 with the same username and password; with the IP allowlist, SOCKS5 works too, on the port you set up in the dashboard.
How IP whitelisting works
With an allowlist, the proxy looks at the public IP each connection comes from and admits it if that IP is on your list. You send no credentials at all, so the proxy setting is just a host and a port.
To set it up:
- Find the public IP of the machine that will use the proxy: run
curl https://api.ipify.orgon it, without a proxy. On a home network this is your router's IP, shared by every device behind it. - Add that IP to the allowlist in your ProxyField account.
- Point the tool at
gate.proxyfield.ioand the port you set up in the dashboard, with no username or password. With the IP allowlist, you connect to the port you set up in the dashboard instead of 7000; the product, location and session are set per port there.
The catch is that many home and mobile connections get a new public IP from time to time, and cloud CI runners use a different IP on each run. When the IP changes, connections fail until you update the list. Allowlisting suits servers and offices with a fixed IP.
Which authentication method should you use?
- Username and password if you move between networks, run scripts on machines whose IP changes, or want to set the country, city and session in the login.
- IP whitelist if the tool has no login fields (the Windows system proxy, a PAC file, some apps and consoles), if a browser keeps asking for the password, or if you don't want credentials stored in code.
- Both on one account, for different tools: for example the allowlist on a fixed-IP server and a username and password on your laptop.
Use an authenticated proxy in common tools
| Tool | How to pass the login | Guide |
|---|---|---|
| curl | -U user:pass or http:// | curl |
| Python requests | proxies={"https": "http:// | Python requests |
| Node.js | a proxy agent with the URL, or the client's proxy option | Node.js |
| Playwright | proxy={"server": ..., "username": ..., "password": ...} | Playwright |
| Puppeteer | --proxy-server plus page.authenticate() | Puppeteer |
| Selenium with Chrome | Chrome's --proxy-server flag takes no login: use an extension, a helper library or the allowlist | Selenium |
| Browsers | a login prompt on first use, or an extension that stores the login | Chrome, Firefox |
In Python, keep the password out of the code by reading it from the environment:
import os
import requests
user = os.environ["PROXY_USER"] # e.g. <login>-country-us-city-new_york
password = os.environ["PROXY_PASS"]
proxy = f"http://{user}:{password}@gate.proxyfield.io:7000"
r = requests.get("https://api.ipify.org", proxies={"http": proxy, "https": proxy}, timeout=30)
print(r.status_code, r.text)Special characters in the password
In a proxy URL, @, :, /, # and % have meanings, so a password that contains them breaks the URL. Percent-encode them: @ becomes %40, : becomes %3A, / becomes %2F, # becomes %23 and % becomes %25 (RFC 3986, section 2.1). In Python, urllib.parse.quote(password, safe="") does it. Separate login fields, such as curl's -U or Playwright's password, take the password as it is.
Keep proxy credentials secure
- Store them in environment variables or your platform's secret store, not in code, and never commit them to git.
- Avoid typing them on the command line where shell history keeps them; read them from a variable or a config file with tight permissions.
- Keep the IP allowlist to the machines that need it. On ProxyField one login serves the whole account, so treat a leaked password as exposing the whole balance.
- If credentials leak, change the proxy password in your account and update your tools.
When authentication fails
A wrong or missing login, or a connection from an IP that isn't on the allowlist, typically ends in 407 Proxy Authentication Required on HTTP proxies and a closed connection on SOCKS5. The 407 error guide lists the causes in order, and the proxy checker tests a login before you put it in a tool.
Proxy Authentication FAQ
What's the difference between username/password and IP whitelist proxy authentication?
ProxyField (residential proxies from $1.95/GB) accepts both: a username and password are checked on every connection to gate.proxyfield.io:7000 and work from any network, while an IP whitelist admits only the public IPs you register, needs no credentials in your tools and uses the port you set up in the dashboard. Use the login when your IP changes or you want targeting in the username, and the allowlist for fixed-IP servers and tools without login fields.
How does proxy authentication work?
An HTTP proxy that needs a login answers 407 Proxy Authentication Required, and the client repeats the request with a Proxy-Authorization header holding the username and password. With an allowlist there is no exchange at all: the proxy simply checks the IP the connection comes from.
How does SOCKS5 authentication work?
During the SOCKS5 handshake the client lists the methods it supports, the server picks username/password, and the client sends both, each up to 255 bytes (RFC 1928 and RFC 1929). The server then accepts or closes the connection.
What is proxy IP whitelisting?
It is a way to use a proxy without a password: you register the public IP addresses of your machines with the provider, and the proxy admits connections only from those IPs. Your tools then need just the host and port.
How do I whitelist my IP for proxy access?
Find the machine's public IP (run curl https://api.ipify.org on it without a proxy), add it to the allowlist in your proxy account, then connect to the proxy host and port with no login. Update the list whenever that IP changes.
How do I authenticate a proxy with username and password?
Put them in the proxy URL, http://<login>:<password>@host:port, or in the tool's separate username and password fields. In curl that is -x host:port -U <login>:<password>; browsers ask for them in a prompt the first time.
Which proxy authentication method should I use?
A username and password if you work from changing networks or want to set the location in the login. An IP allowlist if the machine has a fixed IP, or the tool cannot send a login, such as the Windows system proxy or Chrome with a SOCKS5 proxy.
What proxy authentication methods does ProxyField support?
Two: username and password on the gateway gate.proxyfield.io:7000, and an IP allowlist of up to 100 IPv4 addresses on the port you set up in the dashboard, both set up in your account. You can use them side by side for different tools.
How do I keep proxy credentials secure?
Keep them in environment variables or a secret store, not in code or git, and keep them out of your shell history. If they leak, change the proxy password in your account.
How do I handle proxy authentication with special characters in credentials?
Percent-encode the special characters when the password sits in a proxy URL: @ as %40, : as %3A, / as %2F, # as %23, % as %25. Separate username and password fields take the password unencoded.
Show 3 more questionsShow fewer questions
Is proxy whitelisting more secure than username/password authentication?
It removes the risk of leaked passwords, because there is nothing to leak, but it trusts everything behind the registered IP, such as every device on an office network. A username and password limit access to whoever holds them; many teams use the allowlist on servers and logins on laptops.
How can browser extensions affect proxy authentication?
A proxy extension can store the login and answer the proxy's password request for you, which is why many people use one in Chrome. Two extensions that both manage the proxy can conflict, and only one of them controls the browser's proxy at a time.
Does HTTPS protect proxy credentials?
Not by itself. HTTPS encrypts the traffic between you and the website, but the proxy login is sent before that tunnel starts, as Base64 in a header, so it is readable on the network between you and the proxy unless the connection to the proxy itself is encrypted.