Proxy address, port, username and password
Every working proxy is described by five basic fields: protocol, host address, port, login, and password.
curl sends a request through a proxy with one option, but the scheme in the proxy address, the way you pass the password and the environment variables all change the result. This guide covers each with a short command and shows how to confirm the proxy was used.
The curl manual describes -x, or --proxy, as taking a proxy string in the form [protocol://]host[:port]. With no protocol, or with http://, curl treats it as an HTTP proxy. If you leave out the port, the manual says curl assumes 1080, so always write the port your provider gives you.
curl -x http://proxy-host:port https://ipinfo.io/jsonReplace proxy-host and port with the values from your proxy list.
For an https:// target through an HTTP proxy, the Everything curl book explains that curl asks the proxy for a CONNECT tunnel and then encrypts the traffic inside it, so the proxy cannot read or change the content. Adding -v shows this: you will see curl connect to the proxy, not to the website.
Use -U, or --proxy-user, with user:password, or put the credentials in the proxy address. The curl manual says user and password in the proxy string are URL-decoded by curl, so a character such as @ is written %40 and a colon %3a. This matters because a password with @ or : breaks the address if you do not encode it.
curl -x http://USERNAME:PASSWORD@proxy-host:port https://ipinfo.io/json
curl -U USERNAME:PASSWORD -x http://proxy-host:port https://ipinfo.io/jsonPercent-encode special characters in the password in the first form. In the second form the credentials are given to -U and are not part of the address.
The manual also warns that credentials on the command line can be seen by other users on the same system for a moment, and says sensitive data should be read from a file instead. A config file (below) is one way to do that.
The manual lists socks4://, socks4a://, socks5:// and socks5h:// as the prefixes for SOCKS proxies. The Everything curl book explains the difference: with socks5:// curl resolves the website name itself, and with socks5h:// the hostname is sent to the proxy, so no name lookup happens on your computer. Use socks5h:// when you want the proxy to do the lookup.
curl -x socks5h://USERNAME:PASSWORD@proxy-host:port https://ipinfo.io/jsonUse socks5:// instead if you want curl to resolve the name locally.
If you only need to confirm which protocol your plan supports, the SOCKS5 proxies page lists it, and the proxy address, port and login guide explains the four values you need.
curl also reads environment variables. The manual says they can be written in lower or upper case, that the lower-case version has precedence, and that http_proxy is the exception: it is accepted only in lower case. The Everything curl book explains why: a web server running a CGI script sets HTTP_PROXY from an incoming request header, so curl ignores the upper-case name. The variables are http_proxy, HTTPS_PROXY, ALL_PROXY, which applies when no protocol-specific variable is set, and NO_PROXY.
export http_proxy="http://USERNAME:PASSWORD@proxy-host:port"
export HTTPS_PROXY="http://USERNAME:PASSWORD@proxy-host:port"
export NO_PROXY="localhost,127.0.0.1"
curl https://ipinfo.io/jsonThe proxy value in these variables can use the same prefixes as -x, such as socks5h://.
Per the manual, the --proxy option overrides these variables, and --noproxy with a comma-separated host list, or NO_PROXY, makes curl connect to those hosts directly. Setting --proxy "" overrides a proxy that is set in the environment.
The manual names ~/.curlrc as the default config file, and the Everything curl book says each line holds one option, written with or without the leading two dashes, and that a hash starts a comment. Put the proxy there if you always use it.
# ~/.curlrc
proxy = "http://USERNAME:PASSWORD@proxy-host:port"Keep the file readable only by you, because it contains the password.
Request https://ipinfo.io/json through the proxy. The country and org fields should describe the proxy, not your own connection; how to read them is in the proxy location guide. If the response shows your own address, an option or variable did not apply: check for a NO_PROXY match, an empty --proxy "" or a typo in the variable name.
A 407 status means the proxy did not accept the credentials. The Everything curl book says the 407 response headers tell which authentication method the proxy wants, and that you can ask for --proxy-digest, --proxy-ntlm or --proxy-negotiate, or let curl pick with --proxy-anyauth; Basic is the default. For a plain username and password, first re-copy the values and check the encoding; see the authentication required guide. Connection refused or a timeout usually points to a wrong port or scheme, covered in the connection failed guide. If the same task runs in Python, the requests proxy guide shows the equivalent settings.
Any of these commands only needs the host, port, username and password of a Proxy302 proxy. Rotating residential traffic is billed per GB and the exit country is set when you generate the proxy; HTTP is on port 2222 and SOCKS5 on port 3333 of proxy.proxy302.com. A static ISP IP stays fixed for the whole lease term and does not rotate. The table shows exits in 7 countries from our latest hourly check; the probe sends its request to ChatGPT, which is only an example target. Details are on the rotating residential page and in the proxy location guide.
| Item | City | Network (ISP) | ASN |
|---|---|---|---|
| United States | Baton Rouge, Louisiana | Verizon Business | AS6167 |
| United Kingdom | Birkenhead, England | Virgin Media Limited | AS5089 |
| Germany | Hannover, Lower Saxony | htp GmbH | AS13045 |
| Japan | Saitama, Saitama | JCOM Co., Ltd. | AS9824 |
| Singapore | Yishun New Town, Singapore | Singtel Fibre Broadband | AS9506 |
| Brazil | Silvianópolis, Minas Gerais | intertel telecomunicacao LTDA | AS268801 |
| Indonesia | Jakarta, Jakarta | PT Mahawira Nusantara Grup | AS151576 |
Hourly check of the Proxy302 probe, 28 October 2026, 14:56 UTC: one request to ChatGPT per country through a dynamic residential exit, using the public Proxy302 entry. Only the first three octets of an IP are public. One sample per country, not an average; later checks will differ.
Open the rotating residential page, choose the line, and keep Protocol on HTTP or choose SOCKS5, then click Review cost and generate.
Open My assets (the console page that holds everything you bought) and copy HOST, PORT, USERNAME and PASSWORD. The Connect page shows a ready example with your own endpoint.
Enter the details in the browser or tool you are setting up.
Confirm the exit with https://ipinfo.io/json through the proxy.
From mainland China, start the helper tool from the Connect page first and keep it open while you use the proxy.
The Budget line costs US$1.50 per GB, US$1.35 per GB in a 100 GB package and US$1.20 per GB at 300 GB. There is no free trial, and the smallest purchase is 1 GB. Which exit locations are available changes daily.
The curl documentation explains that the upper-case HTTP_PROXY can be created by a web server for CGI scripts from a request header, so curl accepts only the lower-case name for HTTP. Other proxy variables accept both.
No. For https:// URLs through an HTTP proxy curl already uses a CONNECT tunnel. The manual describes --proxytunnel as making curl tunnel the traffic with a CONNECT request, which matters for non-HTTP protocols such as FTP, and which the HTTPS case already uses.
Percent-encode it in the proxy address: @ becomes %40 and a colon %3a, as the curl manual states. Or pass it with -U.
Use --noproxy with the host name, or --proxy "" to clear a proxy set in the environment.
Official documentation · Confirmed on:
Read on 28 October 2026: -x/--proxy and its schemes (http, socks4, socks4a, socks5, socks5h), default port 1080, URL decoding of the user and password, -U/--proxy-user and its warning, --noproxy, --proxytunnel, the proxy environment variables, the lower-case http_proxy note and ~/.curlrc.
Official documentation · Confirmed on:
Read on 28 October 2026: an HTTP proxy is assumed by default, the CONNECT method for HTTPS targets, and -v showing the connection to the proxy.
Official documentation · Confirmed on:
Read on 28 October 2026: SOCKS4, 4a, 5 and 5h, and which side resolves the hostname.
Official documentation · Confirmed on:
Read on 28 October 2026: [scheme]_proxy variables, ALL_PROXY, NO_PROXY, and why http_proxy is accepted only in lower case.
Official documentation · Confirmed on:
Read on 28 October 2026: one option per line, long options with or without dashes, hash comments.
Official documentation · Confirmed on:
Read on 28 October 2026: -U user:password, Basic by default, --proxy-digest, --proxy-negotiate, --proxy-ntlm, --proxy-anyauth, and the 407 response headers.
Product observation · Confirmed on:
Product facts file of the site (values checked against the console, the backend and the price table on 18-19 October 2026): products, prices in US$ (1 PTC = US$1), lease terms, protocols and ports, countries, quantity limits, no free trial.
Product observation · Confirmed on:
Public JSON of the probe at proxy302.com/live/connectivity/chatgpt.json, read 28 October 2026, 14:56 UTC: one request per exit country through a dynamic residential exit; exit city, ASN, network and response time.
Create an account, top up once, then pick rotating residential, static ISP or datacenter IPs and have one running in your browser within minutes.