cURL
使用 cURL 在命令行使用 RaxyProxy 的快速参考。
基本用法
# HTTP proxy — rotating
curl -x http://USERNAME:PASSWORD@proxy.raxyproxy.com:823 \
https://httpbin.org/ip
# Short form
curl --proxy http://USERNAME:PASSWORD@proxy.raxyproxy.com:823 \
https://httpbin.org/ipSOCKS5
curl --socks5-hostname proxy.raxyproxy.com:824 \
-U USERNAME:PASSWORD \
https://httpbin.org/ip地理定向
# Country — US only (free)
curl -x "http://USERNAME__cr.us:PASSWORD@proxy.raxyproxy.com:823" \
https://httpbin.org/ip
# Multiple countries
curl -x "http://USERNAME__cr.us,gb,de:PASSWORD@proxy.raxyproxy.com:823" \
https://httpbin.org/ip
# Exclude countries
curl -x "http://USERNAME__nocr.cn,ru:PASSWORD@proxy.raxyproxy.com:823" \
https://httpbin.org/ip
# State (2× billing for residential/mobile/datacenter)
curl -x "http://USERNAME__cr.us;state.california:PASSWORD@proxy.raxyproxy.com:823" \
https://httpbin.org/ip
# City
curl -x "http://USERNAME__cr.us;city.losangeles:PASSWORD@proxy.raxyproxy.com:823" \
https://httpbin.org/ip
# ZIP code
curl -x "http://USERNAME__cr.us;zip.90001:PASSWORD@proxy.raxyproxy.com:823" \
https://httpbin.org/ip
# ASN (numeric only — no AS prefix)
curl -x "http://USERNAME__cr.us;asn.15169:PASSWORD@proxy.raxyproxy.com:823" \
https://httpbin.org/ip粘性会话
# Port-based sticky — same IP per port
curl -x http://USERNAME:PASSWORD@proxy.raxyproxy.com:10001 \
https://httpbin.org/ip
# sessid sticky — same IP for ~30 min
curl -x "http://USERNAME__sessid.my-session-1:PASSWORD@proxy.raxyproxy.com:823" \
https://httpbin.org/ip
# Custom TTL — keep IP for 60 minutes
curl -x "http://USERNAME__sessid.my-session-1;sessttl.60:PASSWORD@proxy.raxyproxy.com:823" \
https://httpbin.org/ipPOST 请求
curl -x http://USERNAME:PASSWORD@proxy.raxyproxy.com:823 \
-X POST \
-H "Content-Type: application/json" \
-d '{"key": "value"}' \
https://httpbin.org/post常用标志
| 标志 | 用途 |
|---|---|
-x / --proxy | 设置代理 URL |
-U / --proxy-user | 代理凭据(user:pass) |
--socks5-hostname | SOCKS5 代理(远程解析主机名) |
-k / --insecure | 跳过 TLS 验证(仅限开发) |
--max-time | 总超时时间(秒) |
--connect-timeout | 连接超时时间(秒) |
-A / --user-agent | 设置 User-Agent 请求头 |
-H | 添加自定义请求头 |
-v / --verbose | 显示连接详情(调试有用) |
-w "%{http_code}" | 打印 HTTP 状态码 |