title: Send cURL requests through tor?
body: <p>I have some code that sends curl requests to a website but it only has the one website in it at the moment and I don't want them wrongly banning my server IP. Is there anyway I can send those cURL requests through the tor network?</p>
  
  <p>What software would I need to do it?</p>
  
  <p>Running CentOS 6.5</p>
  
  <pre><code>public function checkLogin2($email, $password, $cookiefile){
          $cookiefile = 'cookies/'.$cookiefile;
          $handle = fopen($cookiefile, 'w+');
                  #$proxy = 'proxy-nl.privateinternetaccess.com:1080';
                  #$us = 'x9597458:Th3hXjVyuD';
          $this-&gt;_curl-&gt;setCookieFile($cookiefile);
          #$this-&gt;_curl-&gt;addOption(CURLOPT_PROXY, $proxy);
          #$this-&gt;_curl-&gt;addOption(CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
                  #$this-&gt;_curl-&gt;addOption(CURLOPT_PROXYUSERPWD, $us);
          $this-&gt;_curl-&gt;setUserAgent('FreshAndroidApp-1.3.1');
          $this-&gt;_curl-&gt;addHeader('Content-Type', 'application/x-www-form-urlencoded');
          $this-&gt;_curl-&gt;addHeader('Cookie', 'JSESSIONID=' . strtoupper(md5(time())));
          $this-&gt;_curl-&gt;addHeader('Cookie2', '$Version=1');
  
          try {
          $HTML = $this-&gt;_curl-&gt;post("URL HERE",
                              array('password' =&gt; $password, 
                                    'emailAddress' =&gt; $email
                              ));         
  
          if(!self::isJson($HTML)){
              return '{"status":"uncheck", "msg":"&lt;font color="red"&gt;&lt;b&gt;Uncheck&lt;/b&gt;&lt;/font&gt; =&gt; ' .$email.'|'.$password.'"}';
  
          }       
          $resp = json_decode($HTML);
  
  
          if($resp-&gt;{'status'} == "success"){
              $details = $this-&gt;_curl-&gt;get('URL HERE');
              return $details;
          } else if ($resp-&gt;{'status'} == "failure"){
              return '{"status":"failure"}';
          }
          fclose($handle);    
          } catch (CurlWrapperException $e){
              return '{"status":"socksfailure", "msg":"'.$proxy. ' =&gt; Die or timeout"}';
          }   
          fclose($handle);
      }
  </code></pre>