Results 1 to 3 of 3

Thread: cUrl using proxy

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    111

    cUrl using proxy

    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

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    111

    Re: cUrl using proxy

    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;
    ?>

  3. #3
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171


    Has someone helped you? Then you can Rate their helpful post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width