curl Proxy Setup
curl is the most widely used command-line tool for making HTTP requests. It comes pre-installed on macOS, Linux, and modern Windows systems. curl is ideal for quick proxy testing, debugging connection issues, and verifying that your Hex Proxies credentials work before integrating into a larger application.
Basic HTTP Proxy with Authentication
curl -x http://gate.hexproxies.com:8080 -U user:pass https://httpbin.org/ipThis routes the request through Hex Proxies and returns the proxy's IP address.
Using Inline Credentials
You can embed credentials directly in the proxy URL:
curl -x http://user:pass@gate.hexproxies.com:8080 https://httpbin.org/ipIP Whitelist Authentication
If your IP is whitelisted in the Hex Proxies dashboard, no credentials are needed:
curl -x http://gate.hexproxies.com:8080 https://httpbin.org/ipSOCKS5 Proxy
curl -x socks5h://user:pass@gate.hexproxies.com:1080 https://httpbin.org/ipUse `socks5h` to resolve DNS through the proxy (prevents DNS leaks).
Geo-Targeted Requests
Append country codes to your username:
curl -x http://gate.hexproxies.com:8080 -U user-country-jp:pass https://httpbin.org/ipVerbose Debugging
curl -v -x http://gate.hexproxies.com:8080 -U user:pass https://httpbin.org/ipThe `-v` flag shows the full connection flow including proxy CONNECT handshake, TLS negotiation, and response headers — essential for diagnosing issues.
Setting Proxy via Environment Variables
export http_proxy=http://user:pass@gate.hexproxies.com:8080
export https_proxy=http://user:pass@gate.hexproxies.com:8080
curl https://httpbin.org/ip # Automatically uses the proxyBest Practices
- Use -v for debugging connection issues — it reveals exactly where the request fails.
- Set timeouts with `--connect-timeout 10 --max-time 30` to avoid hanging requests.
- Test before integrating — verify proxy connectivity with curl before adding proxy config to your application code.
Troubleshooting
- 407 Proxy Authentication Required: Check username and password. Special characters in the password may need URL encoding.
- Connection refused: Verify the proxy host and port. Ensure your firewall allows outbound connections on port 8080.
- SSL certificate errors: Try `--insecure` for testing (not for production). Update your CA bundle if certs are outdated.
- Empty response: Add `--max-time 30` to set a timeout. Residential proxies may take 1-3 seconds to respond.