cURL Integration

Use cURL with Enterprise Proxy Network for command-line HTTP requests

Basic cURL Usage

cURL is a command-line tool for transferring data with URLs. It supports various protocols including HTTP, HTTPS, FTP, and works seamlessly with SOCKS5 proxies.

Basic SOCKS5 Proxy Command

curl -x socks5h://username:password@proxy.enterpriseproxynetwork.com:1080 \ https://api.ipify.org?format=json

This command routes the request through our proxy network and returns your proxy IP address.

Authentication Format

Username

country-sessiontype-customerid

Example: us-socks5-cust_123

Password

Your API Key

Example: sk_live_1234567890abcdef

Advanced Examples

HTTP/HTTPS Proxy

# HTTP proxy curl -x http://username:password@proxy.enterpriseproxynetwork.com:8080 \ http://example.com # HTTPS proxy curl -x https://username:password@proxy.enterpriseproxynetwork.com:8443 \ https://example.com

File Download with Proxy

curl -x socks5h://us-socks5-cust_123:sk_live_123456@proxy.enterpriseproxynetwork.com:1080 \ -o downloaded_file.zip \ https://example.com/large_file.zip

The -o flag saves the output to a file instead of printing to stdout.

API Requests with Headers

curl -x socks5h://us-socks5-cust_123:sk_live_123456@proxy.enterpriseproxynetwork.com:1080 \ -H "Authorization: Bearer YOUR_APP_TOKEN" \ -H "Content-Type: application/json" \ -X POST \ -d '{"key": "value"}' \ https://api.example.com/endpoint

Performance Tips

Connection Reuse

Use connection pooling for multiple requests to the same host:

curl --proxy-keepalive ...

Compression

Enable compression to reduce bandwidth usage:

curl --compressed ...

Timeout Configuration

# Set connection timeout (seconds) curl --connect-timeout 30 ... # Set maximum time for entire operation curl --max-time 300 ... # Retry on failure curl --retry 3 --retry-delay 5 ...

Environment Configuration

Setting Proxy Environment Variables

# For bash/zsh export ALL_PROXY="socks5h://us-socks5-cust_123:sk_live_123456@proxy.enterpriseproxynetwork.com:1080" export HTTP_PROXY="http://us-http-cust_123:sk_live_123456@proxy.enterpriseproxynetwork.com:8080" export HTTPS_PROXY="https://us-https-cust_123:sk_live_123456@proxy.enterpriseproxynetwork.com:8443" # For Windows PowerShell $env:ALL_PROXY = "socks5h://us-socks5-cust_123:sk_live_123456@proxy.enterpriseproxynetwork.com:1080"

Once set, all cURL commands will automatically use the proxy without needing the -x flag.

.curlrc Configuration File

# ~/.curlrc proxy = "socks5h://us-socks5-cust_123:sk_live_123456@proxy.enterpriseproxynetwork.com:1080" connect-timeout = 30 max-time = 300 retry = 3 retry-delay = 5 compressed

Create this file in your home directory to apply these settings to all cURL commands.

Was this helpful?

Help us improve our documentation