cURL is the universal tool for testing APIs and downloading data. Configure SOCKS5 and HTTP proxies for quick testing and scripting.
curl --proxy socks5://user:pass@proxy.proxies.sx:10001 \
https://httpbin.org/ip# Basic SOCKS5 with authentication
curl --proxy socks5://your_username:your_password@proxy.proxies.sx:10001 \
https://httpbin.org/ip
# Short form
curl -x socks5://user:pass@proxy.proxies.sx:10001 https://httpbin.org/ip
# SOCKS5h (DNS through proxy - recommended)
curl --proxy socks5h://user:pass@proxy.proxies.sx:10001 https://httpbin.org/ip# HTTP proxy
curl --proxy http://your_username:your_password@proxy.proxies.sx:10001 \
https://httpbin.org/ip
# Separate user/pass flags
curl --proxy http://proxy.proxies.sx:10001 \
--proxy-user your_username:your_password \
https://httpbin.org/ip
# Using environment variable
export http_proxy="http://user:pass@proxy.proxies.sx:10001"
export https_proxy="http://user:pass@proxy.proxies.sx:10001"
curl https://httpbin.org/ip# With timeout
curl -x socks5h://user:pass@proxy.proxies.sx:10001 \
--connect-timeout 10 \
--max-time 30 \
https://httpbin.org/ip
# Follow redirects
curl -x socks5h://user:pass@proxy.proxies.sx:10001 \
-L \
https://example.com/redirect
# Verbose output (for debugging)
curl -x socks5h://user:pass@proxy.proxies.sx:10001 \
-v \
https://httpbin.org/ip
# Silent mode (suppress progress)
curl -x socks5h://user:pass@proxy.proxies.sx:10001 \
-s \
https://httpbin.org/ip# Custom User-Agent
curl -x socks5h://user:pass@proxy.proxies.sx:10001 \
-H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0.0.0" \
https://httpbin.org/headers
# Multiple headers
curl -x socks5h://user:pass@proxy.proxies.sx:10001 \
-H "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_0)" \
-H "Accept: application/json" \
-H "Accept-Language: en-US,en;q=0.9" \
https://httpbin.org/headers# Form data
curl -x socks5h://user:pass@proxy.proxies.sx:10001 \
-X POST \
-d "username=test&password=secret" \
https://httpbin.org/post
# JSON data
curl -x socks5h://user:pass@proxy.proxies.sx:10001 \
-X POST \
-H "Content-Type: application/json" \
-d '{"key": "value"}' \
https://httpbin.org/post
# File upload
curl -x socks5h://user:pass@proxy.proxies.sx:10001 \
-X POST \
-F "file=@/path/to/file.txt" \
https://httpbin.org/post# Save to file
curl -x socks5h://user:pass@proxy.proxies.sx:10001 \
-o output.html \
https://example.com
# Use remote filename
curl -x socks5h://user:pass@proxy.proxies.sx:10001 \
-O \
https://example.com/file.pdf
# Resume download
curl -x socks5h://user:pass@proxy.proxies.sx:10001 \
-C - \
-O \
https://example.com/large-file.zip#!/bin/bash
# Proxy configuration
PROXY_USER="your_username"
PROXY_PASS="your_password"
PROXY_HOST="proxy.proxies.sx"
PORTS=(10001 10002 10003 10004 10005)
# Function to get random proxy
get_proxy() {
local idx=$((RANDOM % ${#PORTS[@]}))
echo "socks5h://$PROXY_USER:$PROXY_PASS@$PROXY_HOST:${PORTS[$idx]}"
}
# URLs to scrape
URLS=(
"https://httpbin.org/ip"
"https://httpbin.org/headers"
"https://httpbin.org/user-agent"
)
# Scrape each URL with a different proxy
for url in "${URLS[@]}"; do
proxy=$(get_proxy)
echo "Fetching $url via ${proxy##*@}"
curl -s -x "$proxy" "$url" | head -c 200
echo -e "\n---"
done# ~/.curlrc - Default cURL options # Proxy settings proxy = "socks5h://your_username:your_password@proxy.proxies.sx:10001" # Timeouts connect-timeout = 10 max-time = 30 # Follow redirects location # Custom User-Agent user-agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0.0.0" # Silent progress silent # Now just run: curl https://httpbin.org/ip # Proxy is applied automatically
| Option | Description | Example |
|---|---|---|
| -x, --proxy | Set proxy | -x socks5h://user:pass@host:port |
| --proxy-user | Proxy credentials | --proxy-user user:pass |
| -L | Follow redirects | -L |
| -s | Silent mode | -s |
| -v | Verbose (debug) | -v |
| -o | Output to file | -o output.html |
| -H | Custom header | -H "User-Agent: ..." |
| --connect-timeout | Connection timeout | --connect-timeout 10 |
The 'h' suffix routes DNS through the proxy, preventing DNS leaks and enabling access to region-specific domains.
Always use --connect-timeout and --max-time to prevent hanging on slow or unreachable targets.
If your password contains special characters, wrap it in quotes or URL-encode it to avoid shell issues.
The verbose flag shows connection details including proxy handshake. Essential for troubleshooting.
Get mobile proxies and verify your connection in seconds.