Referral Program
Development

cURL Proxy Setup

Route cURL requests through SotaProxy with a single flag.

cURL supports proxies natively with the -x flag. One command addition and every request goes through SotaProxy. Useful for testing proxy connectivity, quick data pulls, and shell scripts.

Setup guide

1

Basic proxy request

bash
curl -x "http://YOUR_USERNAME:YOUR_PASSWORD@proxy.sotaproxy.com:10000" \
     https://httpbin.org/ip

The -x flag sets the proxy. Include credentials in the URL. Works for both HTTP and HTTPS targets.

2

Geo-targeting

bash
# US IP
curl -x "http://YOUR_USERNAME_c_US:YOUR_PASSWORD@proxy.sotaproxy.com:10000" \
     https://httpbin.org/ip

# German IP
curl -x "http://YOUR_USERNAME_c_DE:YOUR_PASSWORD@proxy.sotaproxy.com:10000" \
     https://httpbin.org/ip

Append _c_XX to the username. Use ISO two-letter codes in upper case.

3

Set via environment variable

bash
export HTTPS_PROXY="http://YOUR_USERNAME:YOUR_PASSWORD@proxy.sotaproxy.com:10000"
export HTTP_PROXY="http://YOUR_USERNAME:YOUR_PASSWORD@proxy.sotaproxy.com:10000"

# Now all curl requests use the proxy
curl https://httpbin.org/ip

Setting the environment variables routes all curl requests through the proxy without specifying -x each time.

4

SOCKS5 proxy

bash
curl --socks5 "proxy.sotaproxy.com:SOCKS5_PORT" \
     -U "YOUR_USERNAME:YOUR_PASSWORD" \
     https://httpbin.org/ip

For SOCKS5, use --socks5 instead of -x. Check your SotaProxy dashboard for the SOCKS5 port.

Automate it with the SotaProxy API

Everything above works without opening the dashboard. With an API key, cURL can pull fresh proxy credentials, buy new proxies, and renew expiring ones - straight from code.

bash
# Every active proxy on your account (ip, ports, login, password as JSON)
curl -H "Authorization: Bearer $KEY" https://api.sotaproxy.com/api/v1/proxies

# Buy more when you scale (price-check first with POST /quote)
curl -X POST https://api.sotaproxy.com/api/v1/orders \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: my-unique-order-id" \
  -d '{"product":"ipv4","countryId":565,"periodId":"1m","quantity":5}'
Read the API docs

Flags that matter

curl is the fastest way to prove an address works before you write any code. Both of our address types plug in the same way:

Rotating residential
login:password@proxy.sotaproxy.com:10000
Pinned to a country
login_c_US:password@proxy.sotaproxy.com:10000
Sticky for 15 minutes
login_c_US_s_42_ttl_15m:password@proxy.sotaproxy.com:10000
Static address (ISP, datacenter)
login:password@your-ip:50100, SOCKS5 on 50101

Put credentials in the -x argument or keep them out of shell history with --proxy-user and a netrc file.

Checking what the target sees

Three commands worth keeping around: confirm the exit address, confirm geography, confirm the session holds:

Shell: verify address, geography and stickiness

# which address are we leaving from
curl -x login_c_US:password@proxy.sotaproxy.com:10000 https://api.ipify.org

# what the target sees about that address
curl -x login_c_DE:password@proxy.sotaproxy.com:10000 https://ipinfo.io/json

# does the sticky session hold across calls
for i in 1 2 3; do
  curl -s -x login_c_US_s_9_ttl_15m:password@proxy.sotaproxy.com:10000 https://api.ipify.org
  echo
done

# SOCKS5 with DNS resolved on our side
curl -x socks5h://login:password@proxy.sotaproxy.com:10000 https://api.ipify.org
  • Three identical answers from the sticky loop mean the session works. Three different ones mean a suffix is malformed and you silently got rotation.
  • Add -v when something is wrong. The proxy handshake is visible there and a 407 is unmistakable.
  • Use --compressed to ask for gzip and save residential traffic while testing.
  • For static addresses drop the suffixes entirely and point curl at your-ip:50100, or 50101 for SOCKS5.

curl specifics

socks5 versus socks5h

The first resolves DNS locally, which leaks the target to your resolver and breaks geo-sensitive routing. The h variant resolves remotely.

Passwords in shell history

Anything typed after -x lands in .bash_history. Use --proxy-user with netrc when the machine is shared.

Confusing 407 with a target error

A 407 comes from us and means the login string did not parse. The target never saw the request.

Testing with http:// on an https target

Both go through the same endpoint, but mixing schemes in scripts causes confusing redirects. Match the scheme to the target.

Notes & tips

  • Test connectivity before using in production: curl -x "proxy_url" https://httpbin.org/ip
  • --proxy-insecure skips TLS verification for the proxy connection (not the target) - use only for debugging.
  • cURL respects HTTP_PROXY and HTTPS_PROXY environment variables. Set them in your shell profile for persistent configuration.

FAQ

How do I verify my proxy IP in cURL?

Run: curl -x "http://user:pass@proxy.sotaproxy.com:10000" https://httpbin.org/ip - the response shows the proxy's IP, not yours.

Can I use cURL proxy in shell scripts?

Yes. Set HTTP_PROXY and HTTPS_PROXY as environment variables at the top of your script, or pass -x to each curl call.

Get your proxy credentials

Sign up, top up your balance, and copy your endpoint into cURL. Takes under 5 minutes.

Get started