Hello
Can someone give me a working example on how to use cUrl with proxy?
There are tons of proxies out there.. will all of them work or what?
Thanks
cheers
Adel
Printable View
Hello
Can someone give me a working example on how to use cUrl with proxy?
There are tons of proxies out there.. will all of them work or what?
Thanks
cheers
Adel
Ok i have tried this but it's not working
Code:<?php
$url = 'http://www.myip.dk/';
$ch = curl_init();
curl_setopt($ch, curlOPT_URL,$url);
curl_setopt($ch, curlOPT_HTTPproxyTUNNEL, 1);
curl_setopt($ch, curlOPT_proxy, '121.174.35.26:8080');
//curl_setopt($ch, curlOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, curlOPT_RETURNTRANSFER, 0);
curl_setopt($ch, curlOPT_CUSTOMREQUEST,'GET');
curl_setopt ($ch, curlOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10000);
$html = curl_exec($ch);
curl_close($ch);
echo '<br />';
echo $html;
?>