Docs menu
Docs

Proxy Authentication

Proxy authentication is how a proxy server checks that a request comes from someone allowed to use it before it forwards the request: either with a username and password sent on each connection, or with an IP whitelist (allowlist) that admits only the public IP addresses you register. A username and password work from any network and can carry targeting options; an allowlist keeps credentials out of your tools but stops working when your IP changes. ProxyField accepts both: a username and password on the gateway gate.proxyfield.io:7000, or an allowlisted IP on the port you set up in the dashboard, with residential proxies from $1.95/GB and the Easy Trial: 1 GB for $2.95.

residential IPs
412M+
from, traffic never expires
$1.95/GB
Easy Trial
1 GB for $2.95
gate.proxyfield.io:7000
ProxyField authentication at a glance
SettingProxyField value
Gatewaygate.proxyfield.io:7000 for username and password; HTTP, HTTPS and SOCKS5 on the same host and port
Username<login>-country-us-city-new_york; the optional keys are -country-<cc>, -region-<region>, -city-<city>, -session-<id> and -ttl-<seconds> (30 to 129,600 s, 20 min when ttl is left out); add -mobile or -dc right after the login for mobile or rotating datacenter IPs (-dc takes the country only)
Passwordyour ProxyField password
HTTP and HTTPSBasic proxy authentication (Proxy-Authorization: Basic); for HTTPS, on the CONNECT request
SOCKS5the same username and password, in the SOCKS5 handshake; in a proxy URL, write socks5h:// so the gateway resolves the site's name
IP allowlistup to 100 IPv4 addresses per account, one address on one account only; connect to the port you set up in the dashboard (the product, location and session are set per port in the dashboard); SOCKS5 works with it too
Wrong login407 Proxy Authentication Required with Proxy-Authenticate: Basic, on CONNECT too; on SOCKS5, an authentication failure
Loginsone login per account, with no per-member logins
IP behavioura new IP on every request, or one IP for 30 s to 36 h with -session-<id>-ttl-<seconds>
Headersthe gateway adds no Via, X-Forwarded-For or Forwarded header; the headers your client sends pass through; your Proxy-Authorization is removed before the request goes to the site

Set up proxy authentication with ProxyField

  1. Copy the username and password from your ProxyField account.
  2. Add the location and session to the username, as in <login>-country-us-city-new_york.
  3. 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.
  4. 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.
  5. Send one request to https://api.ipify.org through the proxy and check that the IP is not yours.

One request with the login in curl's -U option:

Shell
curl -x gate.proxyfield.io:7000 -U "<login>-country-us-city-new_york:<password>" https://api.ipify.org

How Proxy-Authenticate and Proxy-Authorization work in general: HTTP authentication (MDN).

On this page 10 sections

Username and password vs IP whitelist

FeatureUsername and passwordIP whitelist (allowlist)
How the proxy knows youthe credentials sent with the connectionthe public IP the connection comes from
Works fromany network, any deviceonly the IPs you registered
When your IP changesnothing breaksyou must update the list
Credentials in your toolsyes, in each proxy setting or scriptnone
Targeting in the loginyes, 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 fieldsnot possible (Windows system proxy, some browser setups)works
Typical fitlaptops, phones, scripts that move between networksservers 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:

  1. Your client sends a request to the proxy without credentials.
  2. The proxy answers 407 Proxy Authentication Required with a Proxy-Authenticate header naming the scheme it accepts, usually Basic.
  3. The client repeats the request with Proxy-Authorization: Basic <base64 of user:password>.
  4. 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:

Shell
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.org

With 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):

  1. The client opens a TCP connection and lists the methods it supports: 0x00 (no authentication) and 0x02 (username/password).
  2. The server picks one. A proxy that requires a login picks 0x02.
  3. The client sends the username and password, each up to 255 bytes, as defined in RFC 1929.
  4. 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:

Shell
curl -x "socks5h://<login>-country-us-city-new_york:<password>@gate.proxyfield.io:7000" https://api.ipify.org

SOCKS5 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:

  1. Find the public IP of the machine that will use the proxy: run curl https://api.ipify.org on it, without a proxy. On a home network this is your router's IP, shared by every device behind it.
  2. Add that IP to the allowlist in your ProxyField account.
  3. Point the tool at gate.proxyfield.io and 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

ToolHow to pass the loginGuide
curl-U user:pass or http://user:pass@host:portcurl
Python requestsproxies={"https": "http://user:pass@host:port"}Python requests
Node.jsa proxy agent with the URL, or the client's proxy optionNode.js
Playwrightproxy={"server": ..., "username": ..., "password": ...}Playwright
Puppeteer--proxy-server plus page.authenticate()Puppeteer
Selenium with ChromeChrome's --proxy-server flag takes no login: use an extension, a helper library or the allowlistSelenium
Browsersa login prompt on first use, or an extension that stores the loginChrome, Firefox

In Python, keep the password out of the code by reading it from the environment:

Python
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.

Easy Trial: 1 GB for $2.95.

Try for the price of 1 GB, no subscription, traffic never expires.