Small script to connect using proxy array with cURL?

Status
Not open for further replies.

chatmasta

New member
Jan 7, 2007
2,613
68
0
NYC
Hey,

I'm about to scrape a site, but I want to be anonymous. I've used cURL before but honestly have no idea how to use proxies with it.

Does anyone have a function that will switch every X connections to the next proxy in an array of proxies?

If you have one it'd be very cool if I could use it. :D I don't expect you to give me your proxy list of course, just the function...

Thanks

EDIT: I think I may have gotten it, but my server is being sluggish...
 


I guess you know php somewhat. Take a look of the proxy things you can set here: PHP: curl_setopt - Manual

and like randomize proxies like this
curl_setotp(CURLOPT_PROXY,$array[mt_rand(0,15)]);

if you have 16 proxies you set 15, you know it starts with 0.
 
Yeah. I tried doing it one way, but then I realized that I must be pretty tired because my logic was saying just do the whole script for each proxy. :D

Thanks.
 
Status
Not open for further replies.