-
Notifications
You must be signed in to change notification settings - Fork 309
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
is there a way to use different proxies for every instances? #36
Comments
Yes, perfect answer given by @imfht (thanks!). This is currently not build into this library. Ether do it with a custom proxy server or develop a solution without puppeteer-cluster. |
@imfht Thank you for your suggestion, this load balancing strategy is really good for scrapping, yet i want each browser instance stick to one specific socks5 proxy(like tor) so sessions wont get blocked for swapping IP. But I guess puppeteer-cluster is not designed to do this kind of task? |
That is currently not supported, but I could modify the library to support your use case (as it is trivial to implement). What you need to do is copy one of the browser concurrency files and implement a custom launch function: If that works for you, I can change the current implementation to support custom concurrency implementations. |
I added a way in version The concurrency implementation can be changed to call the launch function with custom arguments (like proxy) for each worker. Documentation is coming soon. |
Added tests, fixed a bug and added documentation. This feature is now ready to use. Just copy one of the concurreny implementations (like Browser) and provide the class to the |
In my case, I don't know all the proxies IP addresses at cluster instantiation. Proxy IPs and corresponding credentials are obtained from a database and once fetched, a cluster worker needs to be created with these proxy credentials and currently, there is no way to pass any arguments to custom ClusterImplementation on queuing a worker task. Any thoughts on this use case? |
some websites have ip blocking measures, i have to change ip for each instance after a while, is there a way i can use puppeteer-cluster to do that without start a new cluster?
The text was updated successfully, but these errors were encountered: