Skip to content
Nefo

cURL

How to Use a Residential Proxy with cURL

Run cURL requests through Nefo residential proxies to check a credential, a country or a sticky session before you wire the proxy into an application.

Before you start

Nefo offers residential proxies across 227 countries over HTTP, HTTPS, and SOCKS5 with username/password auth. Generate credentials for free in the dashboard proxy generator; only routed traffic consumes your prepaid bandwidth (from 5 GB for $4.50, non-expiring on flexible plans).

cURL is the fastest way to verify a credential and country before wiring it into an application.

  • curl installed (7.21.7+ for socks5h support)
  • A Nefo account with prepaid bandwidth
  • A username/password from /dashboard/generator
  • Your target country token
  • A test endpoint such as https://api.ipify.org

cURL proxy command: HTTP and SOCKS5

Rotating HTTP: This returns a fresh US residential IP.

SOCKS5: The socks5h scheme resolves DNS through the proxy. Change the country token in the username to target any of 227 countries.

shell
# Rotating HTTP
curl -x http://USERNAME-country-us:[email protected]:9000 https://api.ipify.org

# SOCKS5
curl --proxy socks5h://USERNAME-country-us:[email protected]:11000 https://api.ipify.org

cURL rotating vs sticky proxy sessions

Rotating sessions rotate the exit IP each request: HTTP port 9000 or SOCKS5 port 11000. Run a request a few times and you should see different IPs.

Sticky sessions hold one IP from 1 minute up to 24 hours: HTTP port 10000 or SOCKS5 port 12000. Use a token like USERNAME-country-us-session-test1-lifetime-10 to confirm the same IP is returned across repeated calls within the lifetime.

Geo-targeting with the cURL proxy username

Targeting lives in the username token: country across 227 countries, US state and city, or ASN/ISP within a country. Only the username changes, so one command template covers every region.

Use the proxy lawfully, respect the target site's terms of service, and stay within applicable law and reasonable request rates.

Frequently asked questions

Pass the -x flag with the gateway URL, for example -x http://USERNAME-country-us:[email protected]:9000, then the target URL. The username and password in the URL are your Nefo credentials from the proxy generator.

Start with 5 GB. Keep what you don't use.

Residential bandwidth from $0.53/GB that never expires. Card, PayPal, Apple Pay, Google Pay, Alipay and crypto.