Configuración de proxy en cURL
Enruta las solicitudes de cURL por SotaProxy con un solo flag.
cURL admite proxies de forma nativa con el flag -x. Un añadido al comando y cada solicitud pasa por SotaProxy. Útil para probar la conectividad del proxy, extracciones rápidas de datos y scripts de shell.
Guía de configuración
Solicitud básica por proxy
curl -x "http://YOUR_USERNAME:YOUR_PASSWORD@proxy.sotaproxy.com:10000" \
https://httpbin.org/ipEl flag -x establece el proxy. Incluye las credenciales en la URL. Funciona tanto para objetivos HTTP como HTTPS.
Geo-segmentación
# 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/ipAñade _c_XX al nombre de usuario. Usa códigos ISO de dos letras en mayúsculas.
Configurar mediante variable de entorno
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/ipEstablecer las variables de entorno enruta todas las solicitudes de curl por el proxy sin especificar -x cada vez.
Proxy SOCKS5
curl --socks5 "proxy.sotaproxy.com:SOCKS5_PORT" \
-U "YOUR_USERNAME:YOUR_PASSWORD" \
https://httpbin.org/ipPara SOCKS5, usa --socks5 en lugar de -x. Consulta el puerto SOCKS5 en tu panel de SotaProxy.
Automatízalo con la API de SotaProxy
Todo lo anterior funciona sin abrir el panel. Con una clave API, cURL puede obtener credenciales de proxy actualizadas, comprar nuevos proxies y renovar los que caducan - directamente desde el código.
# 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}'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:
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.
Notas y consejos
- •Prueba la conectividad antes de usarlo en producción: curl -x "proxy_url" https://httpbin.org/ip
- •--proxy-insecure omite la verificación TLS para la conexión con el proxy (no con el objetivo) - úsalo solo para depurar.
- •cURL respeta las variables de entorno HTTP_PROXY y HTTPS_PROXY. Configúralas en el perfil de tu shell para una configuración persistente.
FAQ
¿Cómo verifico la IP de mi proxy en cURL?
Ejecuta: curl -x "http://user:pass@proxy.sotaproxy.com:10000" https://httpbin.org/ip - la respuesta muestra la IP del proxy, no la tuya.
¿Puedo usar el proxy de cURL en scripts de shell?
Sí. Establece HTTP_PROXY y HTTPS_PROXY como variables de entorno al inicio de tu script, o pasa -x a cada llamada de curl.
Integraciones relacionadas
Obtén tus credenciales de proxy
Regístrate, recarga tu saldo y copia tu endpoint en cURL. Tarda menos de 5 minutos.
Empezar