dove proxy的使用
官网: https://doveip.com/index.php?s=/index/index.html&lang=en-us
在官网进行登录,就可以使用了。
使用的时候优先使用curl,这样便于修改为ruby的代码,写进脚本进行使用。https://doveip.com/index.php?s=/api_interface/index.html&lang=en-us#show-curl
curl的方法是这样:
1.get token
curl -d "user=abcd&password=abcd" https://dvapi.doveproxy.net/cmapi.php?rq=login
{"errno":200,"msg":"Success","data":{"token":"OXhRbHd2MHVvaWZKckd2Vml0SVArUT09"}}
token是会变化的,但是时间不清楚。
2.get proxy ip
curl -ipv4 -d "user=abc&token=OXhRbHd2MHVvaWZKckd2Vml0SVArUT09&geo=mx" https://dvapi.doveproxy.net/cmapi.php?rq=distribute
{"errno":200,"msg":"Success","data":{"geo":"mx","ip":"47.253.12.97","port":40004,"d_ip":"189.203.105.247"}}
ip:是你即将使用的代理的ip,d_ip是访问的ip,port是端口。
3.used proxy ip
curl -ipv4 --socks5 47.253.12.97:40004 https://www.google.com实际的使用步骤是这样的,首先获得token,使用curl命令输入自己的用户和密码,然后就可以获得对应的token。接着,获得ip的方法使用刚才获得的token和自己的用户名与密码,可以获得对应的ip。最后,使用代理ip,仍然是使用curl命令。即可。
curl -ipv4 --socks5 <你的ip>:<你的端口> https://curl.se/docs/sslcerts.html* Trying 44.193.164.123:58195...
* SOCKS5 connect to IPv4 151.101.193.91:443 (locally resolved)
* SOCKS5 request granted.
* Connected to (nil) (44.193.164.123) port 58195 (#0)
* ALPN, offering h2ls,查看curl到的数据就是页面 对应的内容,OK。