Open abadfox233 opened 4 years ago
当使用OKhttp时,一个爬虫使用代理另一个爬虫不使用代理,不使用代理的爬虫仍然会使用代理。
原因: 问题根源在于OkHttpClientBuilderBox这个类设计不合理,所有爬虫处理时共用一个OkHttpClient.Builder。设置代理后的builder会被污染。
解决方案: 建议取消单例模式,不共用同一个builder
当使用OKhttp时,一个爬虫使用代理另一个爬虫不使用代理,不使用代理的爬虫仍然会使用代理。
原因: 问题根源在于OkHttpClientBuilderBox这个类设计不合理,所有爬虫处理时共用一个OkHttpClient.Builder。设置代理后的builder会被污染。
解决方案: 建议取消单例模式,不共用同一个builder