DrungProxy的代理IP都是从互联网收集,他是架设在一个高度不可用的资源上面的服务。server会负责对这些资源进行清洗、校验、打分,最终输出可以被客户端使用的IP资源。IP资源从入库到最终判定可用生命流程如下
再IP验证的时候,我们设计了一个模型用来确定哪些IP应该优先验证。模型描述如下:长期可用IP检测频率低,长期不可用IP检测评率低。不稳定IP和刚加入的IP检测频率高。我们使用优先队列来实现这个逻辑,所有IP根据分值放在不同优先队列中,每次校验的时候再不同优先队列中拿出一定资源进行校验(不同优先级拿出的资源数目不一样,高优先级的对象拿出更多资源),对于同一个优先队列,我们根据最后验证时间排序。使上次更新时间最久的资源被优先选择。
分发资源的时候,设计去重问题,也就是根据相同条件,每次分发得到的IP很大可能会重复。为了规避这个问题,每次分发都会相应的下发一个资源签名,他会记录分发过的IP。在下次请求的时候,客户端需要带上这个签名,服务器会根据签名过滤,同时会重新对新分发的IP资源做再次签名.
server端使用java编写,使用maven管理项目,使用mysql作为数据库。相关技术包括springMVC,spring,tomcat,mybatis,guava,fastjson,httpclient等。 运行server的方式很简单
mvn install -Dmaven.test.skip=true
mvn tomcat7:run
直接运行项目使用的是我们的默认数据库,同时使用的是默认配置。实际上server存在一些配置用来设置运行参数。合理的运行参数能够合理使用机器资源以及达到更好的运行效果。 项目主要有两个配置文件需要配置:
其他的应该没有了把,哦对了,项目存在多个profile,也就是resources.local,resources.beta,resources.prod等。他们叫做profile,是maven里面的概念,默认是resources.local生效的。如果想使用其他profile下面的配置,则增加 -Pprofile参数,如运行server mvn -Pskyee clean tomcat7:run
{
"data": {
"data": [
{
"id": 257,
"ip": "203.192.12.148",
"proxyIp": "203.192.12.149",
"port": 80,
"ipValue": 3418360980,
"country": "中国",
"area": "华北",
"region": "北京市",
"city": "北京市",
"isp": "",
"countryId": "CN",
"areaId": "100000",
"regionId": "110000",
"cityId": "110100",
"ispId": "-1",
"transperent": 2,
"speed": 104,
"type": 1,
"connectionScore": 1310,
"availbelScore": 8,
"connectionScoreDate": 1475641264000,
"availbelScoreDate": 1475646860000,
"createtime": 1473840886000,
"lostheader": false
},
{
"id": 654,
"ip": "120.55.245.47",
"proxyIp": "112.124.119.21",
"port": 80,
"ipValue": 2016933167,
"country": "中国",
"area": "华东",
"region": "浙江省",
"city": "杭州市",
"isp": "阿里云",
"countryId": "CN",
"areaId": "300000",
"regionId": "330000",
"cityId": "330100",
"ispId": "1000323",
"transperent": 2,
"speed": 83,
"type": 1,
"connectionScore": 1429,
"availbelScore": 2,
"connectionScoreDate": 1475659905000,
"availbelScoreDate": 1475630273000,
"createtime": 1473840884000,
"lostheader": false
},
{
"id": 2489,
"ip": "124.193.33.233",
"proxyIp": "124.193.33.233",
"port": 3128,
"ipValue": 2093031913,
"country": "中国",
"area": "华北",
"region": "北京市",
"city": "北京市",
"isp": "鹏博士",
"countryId": "CN",
"areaId": "100000",
"regionId": "110000",
"cityId": "110100",
"ispId": "1000143",
"transperent": 2,
"speed": 3390,
"type": 1,
"connectionScore": 310,
"availbelScore": 2,
"connectionScoreDate": 1475657685000,
"availbelScoreDate": 1475661878000,
"createtime": 1473839334000,
"lostheader": false
},
{
"id": 5004,
"ip": "203.192.12.146",
"proxyIp": "203.192.12.149",
"port": 80,
"ipValue": 3418360978,
"country": "中国",
"area": "华北",
"region": "北京市",
"city": "北京市",
"isp": "",
"countryId": "CN",
"areaId": "100000",
"regionId": "110000",
"cityId": "110100",
"ispId": "-1",
"transperent": 2,
"speed": 161,
"type": 1,
"connectionScore": 1291,
"availbelScore": 10,
"connectionScoreDate": 1475638336000,
"availbelScoreDate": 1475636727000,
"createtime": 1473840882000,
"lostheader": false
},
{
"id": 5421,
"ip": "221.237.155.64",
"proxyIp": "221.237.155.64",
"port": 9797,
"ipValue": 3723336512,
"country": "中国",
"area": "西南",
"region": "四川省",
"city": "成都市",
"isp": "电信",
"countryId": "CN",
"areaId": "500000",
"regionId": "510000",
"cityId": "510100",
"ispId": "100017",
"transperent": 2,
"speed": 3238,
"type": 1,
"connectionScore": 119,
"availbelScore": -1,
"connectionScoreDate": 1475611973000,
"availbelScoreDate": 1475629954000,
"createtime": 1473840773000,
"lostheader": false
},
{
"id": 8722,
"ip": "58.243.0.162",
"proxyIp": "58.243.0.162",
"port": 9999,
"ipValue": 989003938,
"country": "中国",
"area": "华东",
"region": "安徽省",
"city": "安庆市",
"isp": "联通",
"countryId": "CN",
"areaId": "300000",
"regionId": "340000",
"cityId": "340800",
"ispId": "100026",
"transperent": 2,
"speed": 5143,
"type": 1,
"connectionScore": 154,
"availbelScore": -3,
"connectionScoreDate": 1475665673000,
"availbelScoreDate": 1475614147000,
"createtime": 1473839836000,
"lostheader": false
},
{
"id": 11698,
"ip": "218.7.170.190",
"proxyIp": "218.7.170.190",
"port": 3128,
"ipValue": 3657935550,
"country": "中国",
"area": "东北",
"region": "黑龙江省",
"city": "绥化市",
"isp": "联通",
"countryId": "CN",
"areaId": "200000",
"regionId": "230000",
"cityId": "231200",
"ispId": "100026",
"transperent": 2,
"speed": 3145,
"type": 1,
"connectionScore": 317,
"availbelScore": -1,
"connectionScoreDate": 1475642001000,
"availbelScoreDate": 1475524810000,
"createtime": 1473839128000,
"lostheader": false
},
{
"id": 13318,
"ip": "220.249.185.178",
"proxyIp": "220.249.185.178",
"port": 9999,
"ipValue": 3707353522,
"country": "中国",
"area": "华东",
"region": "福建省",
"city": "福州市",
"isp": "联通",
"countryId": "CN",
"areaId": "300000",
"regionId": "350000",
"cityId": "350100",
"ispId": "100026",
"transperent": 2,
"speed": 5094,
"type": 1,
"connectionScore": 129,
"availbelScore": -1,
"connectionScoreDate": 1475615670000,
"availbelScoreDate": 1475585178000,
"createtime": 1473840539000,
"lostheader": false
},
{
"id": 57033,
"ip": "210.245.25.228",
"proxyIp": "210.245.25.228",
"port": 3128,
"ipValue": 3539278308,
"country": "越南",
"area": "",
"region": "",
"city": "",
"isp": "",
"countryId": "VN",
"areaId": "",
"regionId": "",
"cityId": "",
"ispId": "",
"transperent": 2,
"speed": 1024,
"type": 1,
"connectionScore": 488,
"availbelScore": 36,
"connectionScoreDate": 1475635386000,
"availbelScoreDate": 1475630473000,
"createtime": 1473836572000,
"lostheader": false
},
{
"id": 124334,
"ip": "60.194.72.253",
"proxyIp": "60.194.72.253",
"port": 3128,
"ipValue": 1019365629,
"country": "中国",
"area": "华北",
"region": "北京市",
"city": "北京市",
"isp": "鹏博士",
"countryId": "CN",
"areaId": "100000",
"regionId": "110000",
"cityId": "110100",
"ispId": "1000143",
"transperent": 2,
"speed": 2366,
"type": 1,
"connectionScore": 610,
"availbelScore": 16,
"connectionScoreDate": 1475643516000,
"availbelScoreDate": 1475631080000,
"createtime": 1473839561000,
"lostheader": false
}
],
"num": 10,
"sign": "9999#C99+999#9B99B99999##Y9999+9999999999999999999999t9999s99999999s9999999999999999999999999999#99999999999999GB999999999G9999s9s99999#9999999999Y9+999##99999999+99999999999999+999999999999B999+Y9999G9+99999999999YB99999999999999999999999+99Y999999999B9999G999s99G999999999#99999#9Y999s999999999#B99999999999999999999+999999Y9999999Y9999999999999Y9999Y999999999999999"
},
"status": true
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。