Skip to content

Configure TrueProxies with cURL

Terminal window
curl -x http://YOUR_HOST:YOUR_HTTP_PORT \
-U "your_username:your_password" \
https://httpbin.org/ip

Use the username parameter to target a specific country:

Terminal window
curl -x http://YOUR_HOST:YOUR_HTTP_PORT \
-U "your_username-country-us:your_password" \
https://httpbin.org/ip

Keep the same IP across multiple requests:

Terminal window
curl -x http://YOUR_HOST:YOUR_HTTP_PORT \
-U "your_username-session-abc123:your_password" \
https://httpbin.org/ip
Terminal window
# Follow redirects
curl -L -x http://YOUR_HOST:YOUR_HTTP_PORT \
-U "your_username:your_password" \
https://example.com
# Set timeout (30 seconds)
curl --max-time 30 -x http://YOUR_HOST:YOUR_HTTP_PORT \
-U "your_username:your_password" \
https://httpbin.org/ip
# Save response to file
curl -o response.json -x http://YOUR_HOST:YOUR_HTTP_PORT \
-U "your_username:your_password" \
https://httpbin.org/ip
# Verbose output for debugging
curl -v -x http://YOUR_HOST:YOUR_HTTP_PORT \
-U "your_username:your_password" \
https://httpbin.org/ip

Set proxy globally for all cURL requests in your shell:

Terminal window
export http_proxy="http://your_username:your_password@YOUR_HOST:YOUR_HTTP_PORT"
export https_proxy="http://your_username:your_password@YOUR_HOST:YOUR_HTTP_PORT"
# Now all cURL requests use the proxy
curl https://httpbin.org/ip