Skip to content

Instantly share code, notes, and snippets.

@hassansin
Created June 29, 2015 01:00
Show Gist options
  • Select an option

  • Save hassansin/08fd6616b6be2c70f9e3 to your computer and use it in GitHub Desktop.

Select an option

Save hassansin/08fd6616b6be2c70f9e3 to your computer and use it in GitHub Desktop.

Revisions

  1. Hassansin created this gist Jun 29, 2015.
    25 changes: 25 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@


    /*Use Fiddler Proxy*/
    curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8888');

    /*Use Proxy*/
    curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
    curl_setopt($ch, CURLOPT_PROXY, "IP:PORT");
    curl_setopt($ch, CURLOPT_PROXYUSERPWD, "username:password");

    /*SSL Request*/
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    //curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

    /*Set Headers*/
    curl_setopt($process, CURLOPT_REFERER, $referer); // Referere Header
    curl_setopt($process, CURLOPT_USERAGENT, $userAgent); // User-Agent Header`
    curl_setopt($process, CURLOPT_ENCODING , 'gzip, deflate'); //Accept-Encoding Header
    curl_setopt($process, CURLOPT_HTTPHEADER, $headers); // Other Headers


    /*Use Cookies*/
    $cookie_file = tempnam("/tmp", "cookie")
    curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
    curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);