緣由:需要查詢一下某些代理訪問指定域名所消耗的時間,來判斷是否是代理連線受限
- 以下代理均為示例代理,無法真正連線
1. 通過curl方式來測試指定代理的連線情況,代理無賬號密碼
curl -x 127.0.0.1:9989 https://store.steampowered.com
以上命令為測試代理127.0.0.1:9989訪問https://store.steampowered.com域名的連線情況,訪問成功會返回一個html頁面,否則即為失敗,當然域名要正確合法
2. 通過curl方式來測試指定代理的連線情況,代理有賬號,密碼,域名及埠
curl -x adam:[email protected]:9986 https://store.steampowered.com
以上命令為測試代理域名為: test.proxy.com, 埠為: 9986, 代理賬號為: adam, 代理密碼為: ad147852的代理訪問https://store.steampowered.com域名的連線情況
組合命令為: curl -x account:password@domain:port testDomain
3. 通過curl方式來測試指定代理的連線情況,代理有賬號,密碼,IP及埠<
curl -x adam:[email protected]:9986 https://store.steampowered.com
以上命令為測試代理IP為: 127.0.0.1, 埠為: 9986, 代理賬號為: adam, 代理密碼為: ad147852的代理訪問https://store.steampowered.com域名的連線情況
組合命令為: curl -x account:password@IP:port testDomain
4. 通過curl方式來測試指定代理的訪問指定域名的訪問速度
curl -x adam:[email protected]:9986 /dev/null -s -w %{time_namelookup}:%{time_connect}:%{time_starttransfer}:%{time_total} https://store.steampowered.com
以上命令為查詢代理IP為: 127.0.0.1, 埠為: 9986, 代理賬號為: adam, 代理密碼為: ad147852的代理訪問https://store.steampowered.com域名的訪問速度情況
組合命令為: curl -x account:password@IP:port /dev/null -s -w %{time_namelookup}:%{time_connect}:%{time_starttransfer}:%{time_total} testDomain
time_namelookup對應為解析時間, time_connect對應為建立連線時間, time_starttransfer對應傳輸時間, time_total對應總時間