前言
前几天看了一下github上,IPProxys开源项目(https://github.com/qiyeboy/IPProxys)快100star了,看来大家对这个项目还是比较感兴趣的。最近一直没更新文章,主要是忙实验室的工作和写一个之前给大家提到新的开源项目,我将它命名为PowerProxy,写的过程中遇到了很多问题,算是一个不错的学习经历,对sock5协议,windows内核有了一定的理解。开源的日期还没确定,需要将一些关键问题解决,大家敬请期待。
看到大家对IPProxys项目挺感兴趣,下面就介绍一下它的使用方式。
IPProxys使用
项目依赖
ubuntu,debian下
windows下
如何使用
API 使用方法
模式
GET /
参数
Name Type Description
types int 0: 高匿代理, 1 透明
protocol int 0: http, 1 https
count int 数量
country str 国家
area str 地区
例子
IPProxys默认端口为8000
如果是在本机上测试:
示例代码:
import requests
import json
r = requests.get('http://127.0.0.1:8000/?types=0&count=5&country=中国')
ip_ports = json.loads(r.text)
print ip_ports
ip = ip_ports[0]['ip']
port = ip_ports[0]['port']
proxies={
'http':'http://%s:%s'%(ip,port),
'https':'http://%s:%s'%(ip,port)
}
r = requests.get('http://ip.chinaz.com/',proxies=proxies)
r.encoding='utf-8'
print r.text
TODO