Curl Proxy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Curl Proxy

    Hello :D i have 1 problem :-?
    how to use curl with proxy ? :-? i want to use another ip not mine (server ip)

    i try something like that but doesn`t work :-?

    Code:
    <?php
    $proxy = ""; //<-optional proxy IP
    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL, 'http://site.com'); 
    curl_setopt($ch, CURLOPT_HEADER, 1); 
    if($proxy){
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); 
    curl_setopt($ch, CURLOPT_PROXY, "$proxy"); 
    }
    $data = curl_exec($ch); 
    curl_close($ch); 
    ?>
    you know another code/way to do that ? :-?
    Last edited by soul_reaper; 23.04.11, 13:47.

    #2
    Originally posted by soul_reaper View Post
    Hello :D i have 1 problem :-?
    how to use curl with proxy ? :-? i want to use another ip not mine (server ip)

    i try something like that but doesn`t work :-?

    Code:
    <?php
    $proxy = ""; //<-optional proxy IP
    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL, 'http://site.com'); 
    curl_setopt($ch, CURLOPT_HEADER, 1); 
    if($proxy){
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); 
    curl_setopt($ch, CURLOPT_PROXY, "$proxy"); 
    }
    $data = curl_exec($ch); 
    curl_close($ch); 
    ?>
    you know another code/way to do that ? :-?
    and what is not working in your code? curl will have always the server ip.
    Advertise your mobile site for FREE with AdTwirl

    Comment


      #3
      @GumSlone

      i don`t know :-? that i ask...he show blank page :-? but if i set curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, o); it works :|

      and i have one more question :-? can i change range ip ? :-? not only last numbers
      for last numbers i use curl_setopt ($ch, CURLOPT_INTERFACE, 'your ip');
      and ip i get from cpanel/your list ip
      but i want to set an external ip ,not mine :| i don`t know if you understand
      Last edited by soul_reaper; 23.04.11, 14:29.

      Comment


        #4
        I guess you want to use some proxy IP's to use it in some grabber

        Comment


          #5
          @ViCkSy

          yes :D

          Comment


            #6
            You can debug by using:
            PHP Code:
            print curl_error(); 

            Comment


              #7
              Originally posted by soul_reaper View Post
              @GumSlone

              i don`t know :-? that i ask...he show blank page :-? but if i set curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, o); it works :|

              and i have one more question :-? can i change range ip ? :-? not only last numbers
              for last numbers i use curl_setopt ($ch, CURLOPT_INTERFACE, 'your ip');
              and ip i get from cpanel/your list ip
              but i want to set an external ip ,not mine :| i don`t know if you understand
              the curl connection will have the ip of the server from which you connect, your sites ip.
              Advertise your mobile site for FREE with AdTwirl

              Comment


                #8
                how to create proxy php code with random useragent and ip addres,?

                Comment


                  #9
                  Originally posted by coangcoet View Post
                  how to create proxy php code with random useragent and ip addres,?
                  There are many proxy scripts on internet, which are free and/or open source, but I am not finding any to work as I expect.
                  mysterio.al - programming is a functional art

                  Comment


                    #10
                    I use a moded version of http://www.phpmyproxy.com :P

                    Comment


                      #11
                      thanks boz

                      Comment


                        #12
                        i also need a similar script........

                        i m creating a grabber for which i need to verify the user agent of the script as a mobile browser

                        Comment


                          #13
                          Originally posted by GumSlone View Post
                          the curl connection will have the ip of the server from which you connect, your sites ip.
                          I would like to access google voice with this.. cause in my country google voice is not available...

                          can you make a script to access google.com/voice with US ip ?

                          Comment


                            #14
                            Originally posted by BioBeo View Post
                            I would like to access google voice with this.. cause in my country google voice is not available...

                            can you make a script to access google.com/voice with US ip ?
                            Try to use VPN
                            Did I help you?
                            You can help me too
                            Your donations will help me finance my studies.

                            Comment


                              #15
                              how to grab web proxy example dartspeed.info

                              Comment

                              Working...
                              X