com.xuxueli.crawler.proxy.ProxyMaker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xxl-crawler Show documentation
Show all versions of xxl-crawler Show documentation
A distributed web crawler framework.
The newest version!
package com.xuxueli.crawler.proxy;
import java.net.Proxy;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
/**
* proxy macker
*
* @author xuxueli 2017-11-07 19:52:33
*/
public abstract class ProxyMaker {
protected List proxyList = new CopyOnWriteArrayList(); // 请求代理池,对抗反采集策略规则WAF
public ProxyMaker addProxy(Proxy proxy) {
this.proxyList.add(proxy);
return this;
}
public ProxyMaker addProxyList(List proxyList) {
this.proxyList.addAll(proxyList);
return this;
}
public ProxyMaker clear() {
this.proxyList.clear();
return this;
}
/**
* make proxy
*
* @return Proxy
*/
public abstract Proxy make();
}