한 라이너#
curl -x http://USER-cc-us:PASS@res.proxy-cyber.com:9000 https://api.ipify.org-x (주) --proxy) 임베디드를 가진 프록시 URL이 걸립니다. CONNECT를 가진 cURL 갱도 HTTPS 목적지는 자동적으로, 그리고 호스트명을 해결하기 위해 프록시를 요청합니다.
알고있는 깃발#
| 팟캐스트 | 제품정보 |
|---|---|
| -x, --proxy URL | 프록시 : 계획, 호스트, 포트, 옵션 자격 |
| -U, --proxy-user 사용자:pass | 비밀번호가 특별한 문자가 있을 때 별도의 Credentials |
| --proxy-basic | Force Basic proxy 인증(비밀번호가 부여될 때 기본값) |
| -V의 | CONNECT 교환, 프록시 상태 코드 및 응답 헤더 보기 |
| --noproxy '*' --noproxy '*' | Ignore proxy 환경 변수를 이 호출합니다. |
| -w '%{time_total}\n' | 출구를 비교하는 인쇄 타이밍 |
SOCKS5 및 원격 DNS#
# Hostname resolved at the exit (recommended)
curl -x socks5h://USER-cc-de:PASS@res.proxy-cyber.com:9001 https://api.ipify.org
# Hostname resolved locally, then the IP is sent to the proxy (leaks the lookup)
curl -x socks5://USER-cc-de:PASS@res.proxy-cyber.com:9001 https://api.ipify.org환경 변수#
cURL에 쉘을 넣는 도구, 그리고 많은 다른 사람, 명예 http_proxy, https_proxy 으로 no_proxy. 작업의 세션을 한 번 내보내기.
export https_proxy="http://USER-cc-us:PASS@res.proxy-cyber.com:9000"
export http_proxy="$https_proxy"
export no_proxy="localhost,127.0.0.1"
curl https://api.ipify.org # proxied without -x실패를 읽고#
curl -v -x http://USER:WRONG@res.proxy-cyber.com:9000 https://api.ipify.org 2>&1 | grep -E "CONNECT|HTTP/1.1 4|HTTP/1.1 5"
# < HTTP/1.1 407 Proxy Authentication Required -> credentials
# < HTTP/1.1 400 Bad Request -> a username parameter is wrong
# < HTTP/1.1 502 Bad Gateway -> no exit for that location; widen itCONNECT 라인의 상태는 게이트웨이에서 옵니다; 후에 상태 Connection established 목적지에서 온다. The 오류 페이지 모든 게이트웨이 코드 맵.
루프에서 세션을 회전#
for i in $(seq 1 5); do
curl -s -x "http://USER-cc-us-sid-run$i-ttl-5m:PASS@res.proxy-cyber.com:9000" https://api.ipify.org
echo
done # five different United States exits, each reusable for five minutes under its id자주 묻는 질문#
cURL은 프록시를 통해 HTTPS의 특별한 플래그가 필요합니까?
아니요. http:// 프록시 URL cURL 문제 CONNECT for https:// destinations automatically; --proxytunnel 만 일반 HTTP에서 터널을 강제하기위한 문제.
내 비밀번호는 @ 또는 : 및 cURL이 실패합니다.
-U user:pass 대신 URL에 URL을 삽입하거나 URL을 인코딩하여 특수 문자를 붙여넣기만 합니다.