Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

代理问题 #56

Open
abadfox233 opened this issue Jan 16, 2020 · 0 comments
Open

代理问题 #56

abadfox233 opened this issue Jan 16, 2020 · 0 comments

Comments

@abadfox233
Copy link

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

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant