Using PHP cURL with HTTP debugging proxy

I am using the "Fiddler" application to debug a GET attempt to a website via PHP cURL. To see the cURL traffic, I had to indicate that the cURL connection uses the Fiddler proxy (see code below).

$ch = curl_init();

curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8888'); 

curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'read_header');  
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);    
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_REFERER, "http://domain.com");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_COOKIEJAR, "my_cookies.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "my_cookies.txt");
curl_setopt($ch, CURLOPT_URL, "http://domain.com");

$response = curl_exec($ch);

But the problem is that in Fiddler I can only see this:

Request (domain.com is just an alias):

  CONNECT domain.com:80 HTTP/1.1

Answer:

  HTTP/1.1 200 Blind-Connection Established

If I manually load the website in a browser, Fiddler gives me more information. I can see cookies, header information and what I get through GET.

Any ideas why Fiddler cannot see more useful information from PHP cURL?

: " HTTPS-" "/ Fiddler" /HTTPS ( , , cURL HTTPS).

, , :

HTTP/1.1 502 Connection failed

: , "" , Fiddler, Fiddler, .

+3
1

"Blind-Connection Established" , " HTTPS" "/ Fiddler" /HTTPS.

+3

Source: https://habr.com/ru/post/1721595/


All Articles