samc621 / SneakerBot

All-in-one bot, with auto captcha-solving and proxy management, using Node.js and Puppeteer.
MIT License
744 stars 192 forks source link

Not working using proxy #29

Open donghungx opened 3 years ago

donghungx commented 3 years ago

For example using proxy like this in footsites.js

await useProxy(page, proxy);

The site is opening fine, but then it display a lightbox SOME THING HAVE BEEN WRONG, then I can't add to cart, and the browser keep download something from the footsite.

but if I modify like this in helpers/cluster.js, removed use useProxy

added args --proxy-server=http://${PROXY_SERVER_IP}:${PROXY_SERVER_PORT}

Then everything go just fine, problem is if using like that I can't not set proxy for each task.

Any ideas?

Thank you

samc621 commented 3 years ago

@donghungx can you add some screenshots or a stack trace of the proxy issue you're facing? If it is necessary that we use this arg, we can probably find a workaround, but the proxies had been working for me as-is.

donghungx commented 3 years ago

Hi yes, this is the problem i captured. overall, the "useProxy" seen like connect very slow at the first time. It took like 2 minutes for the website show up. But if use args it was much faster.

Tried to use this library https://github.com/gajus/puppeteer-proxy, it way faster too, but facing same problem I described above. Maybe footsites just changed recently?

Screen Shot 2021-06-09 at 21 11 22

This file keep being downloaded

Screen Shot 2021-06-09 at 21 24 28

I'm using paid proxy which is clean and fast.

Thank you so much.

samc621 commented 3 years ago

Hi @donghungx, thanks for the update. I found some issues with puppeteer-page-proxy and tried updating all relevant dependencies, to no avail. So, I implemented the proxy connection as you suggested on this commit here. Please test the latest code on master and let me know if the proxy connection issues persist.

authsoftware commented 3 years ago

I tried using the latest code on master for the proxy connection but I receive this error on foots, have not tested on other sites,

[6/13/2021, 8:26:30 PM] - Searching for product by product code
[6/13/2021, 8:26:30 PM] - Error: net::ERR_NO_SUPPORTED_PROXIES at https://www.champssports.com/search?query=EY2763
samc621 commented 3 years ago

@authsoftware sounds like a proxy authentication issue, please see this issue.

samc621 commented 3 years ago

@authsoftware @donghungx @labboy0276 @cimthog I have just opened a PR that should hopefully fix the proxy issues. From my understanding of what's going on, it seems like the sites are blocking certain proxies, so this PR implements some proxy chaining. It's working for me, but I'd like others to verify the change before I merge it onto master. Thanks!