cURL

Send cURL requests through NyxonProxies: the -x and -U options, country targeting, sticky sessions, SOCKS5 with remote DNS, config files, Windows and debugging.

cURL is the quickest way to test a proxy, and every check in these docs starts with it. This page covers the options you need with NyxonProxies, from a first request to sessions, SOCKS5 and debugging.

Basic request

Pass the proxy with -x (or --proxy), with the username and password inside the URL:

bash
curl -x http://USERNAME:[email protected]:8080 https://api.ipify.org

The output is the IP the website sees. The proxy URL starts with http:// even for HTTPS sites: cURL asks the gateway to open a tunnel and runs TLS to the site inside it, end to end.

Use the host and port of your product, see Endpoints and ports.

Credentials in their own option

-U (or --proxy-user) keeps the credentials out of the proxy URL, which is easier to read once the username carries parameters:

bash
curl -x http://geo.gw.nyxon.sh:8080 -U "USERNAME-country-de:PASSWORD" https://ipinfo.io/json

This asks for a German exit and prints the location details of the IP. Keep the quotes, so the shell does not split the value.

Keep the same IP

Add a session to the username. Every request with the same session ID leaves from the same IP:

bash
curl -x http://geo.gw.nyxon.sh:8080 -U "USERNAME-country-de-session-a1b2c3d4-time-10:PASSWORD" https://api.ipify.org

Run it twice and both runs print the same address. Change a1b2c3d4 to get a new one. time-10 holds the IP for up to 10 minutes, see Rotating and sticky sessions.

Rotating IPs

Each cURL run opens a new connection to the gateway, so without a session every run gets a new IP. One command that fetches several URLs from the same site reuses its connection, so those requests share one IP:

bash
curl -x http://USERNAME:[email protected]:8080 https://api.ipify.org https://api.ipify.org

Run separate commands, or use a sticky session per job, when you need control over which requests share an IP.

SOCKS5

Use the SOCKS5 port with the socks5h:// scheme:

bash
curl -x socks5h://USERNAME:[email protected]:1080 https://api.ipify.org

With socks5h://, the gateway resolves the hostname, so your DNS lookups do not leave from your own network. With socks5://, cURL resolves the name itself and sends only the IP.

Use the proxy for every command

Set the proxy in the environment and every cURL command in that shell uses it:

bash
export https_proxy="http://USERNAME:[email protected]:8080"
export http_proxy="$https_proxy"
curl https://api.ipify.org

cURL reads http_proxy only in lower case. See Environment variables for the rules other tools follow.

You can also keep the settings in a config file and load it with -K:

text
proxy = "http://geo.gw.nyxon.sh:8080"
proxy-user = "USERNAME-country-us:PASSWORD"
bash
curl -K nyxon.curlrc https://api.ipify.org

Saved as .curlrc in your home folder (%USERPROFILE%\.curlrc on Windows), the file applies to every command without -K.

Skip the proxy for some hosts

--noproxy takes a comma-separated list of hosts that go direct:

bash
curl -x http://USERNAME:[email protected]:8080 --noproxy "localhost,127.0.0.1,.example.com" https://api.ipify.org

A leading dot, as in .example.com, matches the domain and its subdomains.

Windows

cURL ships with Windows 10 and 11. In Windows PowerShell, curl is an alias for Invoke-WebRequest, which takes different options, so type curl.exe:

powershell
curl.exe -x http://USERNAME:[email protected]:8080 https://api.ipify.org

In Command Prompt, wrap values in double quotes, not single quotes.

Debug a request

-v prints the tunnel request and the gateway's answer, which is the fastest way to spot a 407. To see the gateway's status and the website's status side by side:

bash
curl -s -o /dev/null -x http://USERNAME:[email protected]:8080 -w "proxy: %{http_connect}  site: %{http_code}\n" https://api.ipify.org

proxy: 200 means the gateway opened the tunnel. proxy: 407 means it refused the credentials, and the site was never contacted. To see where the time goes:

bash
curl -s -o /dev/null -x http://USERNAME:[email protected]:8080 -w "connect %{time_connect}s  tls %{time_appconnect}s  first byte %{time_starttransfer}s  total %{time_total}s\n" https://api.ipify.org

The Error codes page lists cURL's proxy errors and what each one means.

Last updated

Still stuck?

People answer the live chat around the clock. Send the proxy line you used (without the password) and the error you see.