拿到代理 IP 后,最快速的验证方式就是用 curl 命令,无需写程序即可测试连通性和出口 IP。
测试 HTTP 代理
curl -x http://用户名:密码@IP:端口 https://httpbin.org/ip
返回的 JSON 里 origin 字段就是代理出口 IP,确认它不是你本机 IP 即代表代理生效。
测试 SOCKS5 代理
curl -x socks5://用户名:密码@IP:端口 https://httpbin.org/ip
测延迟
curl -x http://用户名:密码@IP:端口 -o /dev/null -s -w "耗时: %{time_total}s\n" https://www.baidu.com
验证匿名度
访问 https://httpbin.org/headers,检查返回的请求头中是否还带有你的真实 IP 或代理特征字段。
批量测试时写个 shell 循环,把多个 IP 依次跑一遍,快速筛出可用 IP。
