DocsHướng DẫncURL & CLI

cURL & CLI

Cập nhật: Tháng 5, 2026

Dùng DanCuProxy với cURL và công cụ dòng lệnh. cURL cũng tốt để test kết nối proxy.

HTTP Proxy

# Basic HTTP proxy curl -x http://user:[email protected]:1337 https://api.ipify.org # With verbose output curl -v -x http://user:[email protected]:1337 https://api.ipify.org # Using environment variable export https_proxy="http://user:[email protected]:1337" curl https://api.ipify.org

SOCKS5 Proxy

# SOCKS5 proxy curl --socks5 77.81.103.197:1338 --proxy-user user:pass https://api.ipify.org # SOCKS5 with DNS resolution through proxy curl --socks5-hostname 77.81.103.197:1338 --proxy-user user:pass https://api.ipify.org

Nâng Cao

Các mẫu cURL nâng cao với proxy:

# Custom headers with proxy curl -x http://user:[email protected]:1337 \ -H "User-Agent: Mozilla/5.0" \ -H "Accept-Language: en-US" \ https://httpbin.org/headers # Follow redirects through proxy curl -L -x http://user:[email protected]:1337 https://example.com # Measure response time curl -o /dev/null -s -w "Total: %{time_total}s\n" \ -x http://user:[email protected]:1337 https://api.ipify.org

Tích Hợp wget

Dùng biến môi trường để chuyển hướng wget qua proxy:

# wget with proxy export https_proxy="http://user:[email protected]:1337" wget https://api.ipify.org -qO-
Mẹo
Dùng flag -v (verbose) khi debug kết nối proxy. Nó hiển thị toàn bộ quá trình handshake.