Ir al contenido
GProxy
Registro
Гайды 1 min de lectura 101 vistas

Usando Proxies con cURL

Cómo usar proxies en línea de comandos con la utilidad cURL: HTTP, SOCKS, autenticación y ejemplos.

cURL CLI
Usando Proxies con cURL

Uso de Proxies con cURL

cURL es una potente utilidad de línea de comandos para HTTP. Soporta excelentemente todos los tipos de proxy.

Sintaxis Básica

curl -x [protocol://]host:port URL

Proxy HTTP

# Solicitud simple a través de proxy
curl -x http://proxy.example.com:8080 https://httpbin.org/ip

# Con autenticación
curl -x http://user:password@proxy.example.com:8080 https://httpbin.org/ip

# O por separado
curl -x http://proxy.example.com:8080 -U user:password https://httpbin.org/ip

Proxy HTTPS

curl -x https://proxy.example.com:8080 https://httpbin.org/ip

Proxy SOCKS

# SOCKS4
curl --socks4 proxy.example.com:1080 https://httpbin.org/ip

# SOCKS4A (DNS a través de proxy)
curl --socks4a proxy.example.com:1080 https://httpbin.org/ip

# SOCKS5
curl --socks5 proxy.example.com:1080 https://httpbin.org/ip

# SOCKS5 con DNS a través de proxy (recomendado)
curl --socks5-hostname proxy.example.com:1080 https://httpbin.org/ip

Variables de Entorno

# Establecer proxy globalmente
export http_proxy=http://proxy.example.com:8080
export https_proxy=http://proxy.example.com:8080

# Ahora todas las solicitudes pasan por el proxy
curl https://httpbin.org/ip

# Ignorar proxy para ciertos hosts
export no_proxy=localhost,127.0.0.1,.internal.com

Opciones Útiles

# Mostrar tiempo de conexión
curl -x http://proxy:8080 -w "Time: %{time_total}s\n" https://httpbin.org/ip

# Ignorar errores SSL
curl -x http://proxy:8080 -k https://example.com

# Establecer tiempo de espera
curl -x http://proxy:8080 --connect-timeout 10 https://httpbin.org/ip

# Seguir redirecciones
curl -x http://proxy:8080 -L https://httpbin.org/redirect/3

# Guardar cookies
curl -x http://proxy:8080 -c cookies.txt https://example.com

# Enviar solicitud POST
curl -x http://proxy:8080 -X POST -d "data=value" https://httpbin.org/post

Script de Verificación de Lista de Proxies

#!/bin/bash
while read proxy; do
    result=$(curl -x "$proxy" -s --connect-timeout 5 https://httpbin.org/ip)
    if [ $? -eq 0 ]; then
        echo "[OK] $proxy"
    else
        echo "[FAIL] $proxy"
    fi
done < proxies.txt

Depuración

# Salida detallada
curl -x http://proxy:8080 -v https://httpbin.org/ip

# Mostrar solo cabeceras
curl -x http://proxy:8080 -I https://httpbin.org/ip
Actualizado: 09.01.2026
Volver a la categoría

Pruebe nuestros proxies

20,000+ proxies en 100+ países del mundo

support_agent
GProxy Support
Usually replies within minutes
Hi there!
Send us a message and we'll reply as soon as possible.