zhegexiaohuozi / SeimiCrawler

一个简单、敏捷、分布式的支持SpringBoot的Java爬虫框架;An agile, distributed crawler framework.
http://seimicrawler.org
Apache License 2.0
1.98k stars 679 forks source link

代理问题 #56

Open abadfox233 opened 4 years ago

abadfox233 commented 4 years ago

当使用OKhttp时,一个爬虫使用代理另一个爬虫不使用代理,不使用代理的爬虫仍然会使用代理。

原因: 问题根源在于OkHttpClientBuilderBox这个类设计不合理,所有爬虫处理时共用一个OkHttpClient.Builder。设置代理后的builder会被污染。

解决方案: 建议取消单例模式,不共用同一个builder