Advertisement
Googleinurl

Curl + Proxy

Oct 26th, 2012
943
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. <?php
  2. $url = 'http://dynupdate.no-ip.com/ip.php';
  3. $proxy = '127.0.0.1:8888';
  4. //$proxyauth = 'user:password';
  5.  
  6. $ch = curl_init();
  7. curl_setopt($ch, CURLOPT_URL,$url);
  8. curl_setopt($ch, CURLOPT_PROXY, $proxy);
  9. //curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyauth);
  10. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  11. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  12. curl_setopt($ch, CURLOPT_HEADER, 1);
  13. $curl_scraped_page = curl_exec($ch);
  14. curl_close($ch);
  15.  
  16. echo $curl_scraped_page."\n\n";
  17.  
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement