检查代理ip的连通性
检查代理ip的连通性
curl -v -L -x http://tLNiCWImnF:wyXqJAkaMD@116.8.115.22:2323 ip.me
curl -v -L -x http://tLNiCWImnF:wyXqJAkaMD@116.8.115.22:2323 httpbin.org/ip
curl -v -L -x http://tLNiCWImnF:wyXqJAkaMD@116.8.115.22:2323 ipleak.net
curl -v -L -x http://gIjLRiTEIr:iTTMsNEHUQ@171.110.82.109:2323 baidu.com
https://www.ipip.cn/tools/ip
https://www.speedtest.cn/
https://ipcelou.com/
curl -v -x http://JNaWErdPsN:NUCFfiabaF@180.127.146.124:23106 baidu.com
* Trying 180.127.146.124:23106...
* Connected to 180.127.146.124 (180.127.146.124) port 23106
* Proxy auth using Basic with user 'JNaWErdPsN'
> GET http://baidu.com/ HTTP/1.1
> Host: baidu.com
> Proxy-Authorization: Basic Sk5hV0VyZFBzTjpOVUNGZmlhYmFG
> User-Agent: curl/8.4.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 301 Moved Permanently
< Location: https://www.baidu.com/
< Date: Sun, 19 Jul 2026 05:11:14 GMT
< Content-Length: 57
< Content-Type: text/html; charset=utf-8
<
<a href="https://www.baidu.com/">Moved Permanently</a>.
* Connection #0 to host 180.127.146.124 left intact
先看结果解读
这条 curl 代理是通的、鉴权也正常生效了:
- TCP 连接代理成功
- Basic 账号密码认证通过,代理返回
301 Moved Permanently - 拿到百度返回的跳转页面,没有断开、没有 56 报错
报错消失,说明:
- 带账号密码的付费/长效代理和刚才无鉴权免费代理完全不一样;
- 单纯访问
http://baidu.com(明文HTTP)能正常走代理; - 问题出在:百度会强制跳转到
https://www.baidu.com,而访问HTTPS需要CONNECT隧道。
问题:不加-L只会拿到301跳转,不会自动访问https
你当前命令只获取了跳转提示,没有跟进HTTPS页面,加 -L 跟随重定向:
curl -v -L -x http://JNaWErdPsN:NUCFfiabaF@180.127.146.124:23106 baidu.com
执行后会发生两步:
- GET http://baidu.com → 301 跳 https://www.baidu.com
- curl 发起
CONNECT www.baidu.com:443请求代理建立HTTPS隧道
两种情况区分
情况1:代理支持HTTPS隧道(正常付费高匿代理)
能完整加载百度首页,返回大量html内容,无报错。
情况2:代理仅支持HTTP明文、不支持CONNECT隧道
跟随重定向后会出现 Proxy CONNECT aborted 断开,和你上一个IP现象一致。
验证代理是否支持HTTPS隧道(直接访问https地址)
直接请求https,跳过301跳转测试隧道能力:
curl -v -x http://JNaWErdPsN:NUCFfiabaF@180.127.146.124:23106 https://www.baidu.com
- 能正常返回页面 = 支持HTTPS隧道;
- 报CONNECT aborted = 只能访问http网站,不能访问https。
补充实用参数优化(爬虫常用)
- 自定义UA避免识别拦截
- 设置超时防止卡死
curl -v -L --connect-timeout 10 -A "Mozilla/5.0 Windows NT 10.0 Win64 x64 Chrome/120.0.0.0" -x http://JNaWErdPsN:NUCFfiabaF@180.127.146.124:23106 baidu.com
总结对比你两条IP的差异
116.1.7.250:2324无账号免费代理:端口通,但无鉴权直接拒绝CONNECT隧道,56重置;180.127.146.124:23106带账号付费代理:鉴权正常,HTTP明文访问完全可用,仅取决于是否开通HTTPS隧道权限。