GithubHelp home page GithubHelp logo

sosojustdo / proxy-pool Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chenerzhu/proxy-pool

0.0 2.0 0.0 231 KB

java代理IP池 Proxy Pool,提供可用率达到95%以上的代理IP。

Java 97.35% HTML 2.65%

proxy-pool's Introduction

proxy-pool 代理IP

背景

前段时间,写java爬虫来爬网易云音乐的评论。不料,爬了一段时间后ip被封禁了。由此,想到了使用ip代理,但是找了很多的ip代理网站,很少有可以用的代理ip。于是,抱着边学习的心态,自己开发了一个代理ip池。

相关技术及环境

技术: SpringBoot,SpringMVC, Hibernate, MySQL, Redis , Maven, Lombok, BootStrap-table,多线程并发
环境: JDK1.8 , IDEA

实现功能

通过ip代理池,提供高可用的代理ip,可用率达到95%以上。

{
    "code":200,
    "data":[
        {
            "available":true,
            "ip":"1.10.186.214",
            "lastValidateTime":"2018-09-25 20:31:52",
            "location":"THThailand",
            "port":57677,
            "requestTime":0,
            "responseTime":0,
            "type":"https",
            "useTime":3671
        }
    ],
    "message":"success"
}

设计思路

模块划分

  • 爬虫模块:爬取代理ip网站的代理IP信息,先通过队列再保存进数据库。
  • 数据库同步模块:设置一定时间间隔同步数据库IP到redis缓存中。
  • 缓存redis同步模块:设置一定时间间隔同步redis缓存到另一块redis缓存中。
  • 缓存redis代理ip校验模块:设置一定时间间隔redis缓存代理ip池校验。
  • 前端显示及接口控制模块:显示可用ip页面,及提供ip获取api接口。

架构图

IP来源

代理ip均来自爬虫爬取,有些国内爬取的ip大多都不能用,代理池的ip可用ip大多是国外的ip。爬取的网站有:http://www.xicidaili.com/nnhttp://www.data5u.com/free/index.shtmlhttps://free-proxy-list.nethttps://www.my-proxy.com/free-proxy-list.htmlhttp://spys.one/en/free-proxy-list/https://www.proxynova.com/proxy-server-list/https://www.proxy4free.com/list/webproxy1.htmlhttp://www.gatherproxy.com/

如何使用

前提: 已经安装JDK1.8环境,MySQL数据库,Redis。
先使用maven编译成jar,proxy-pool-1.0.jar。
使用SpringBoot启动方式,启动即可。

java -jar proxy-pool-1.0.jar

proxy-pool's People

Contributors

chenerzhu avatar

Watchers

James Cloos avatar sosojustdo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.