CURLE_RECV_ERROR 56 when trying to open proxy url

I am trying to send curl requests using a proxy. When I send such requests using the POST method, it works fine, but it does not work with the GET method, and I get:

CURLE_RECV_ERROR (56) - Failure to receive data from a partner.

Possible reason why this is happening?

The code below returns this error, while when executed with a different URL using the POST method, it works fine.

$handle = curl_init($url); curl_setopt($handle, CURLOPT_POST , 0); curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); curl_setopt($handle, CURLOPT_HEADER , 1); curl_setopt($handle, CURLOPT_MAXREDIRS , 5); curl_setopt($handle, CURLOPT_FOLLOWLOCATION, true); curl_setopt($handle, CURLOPT_USERAGENT , 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4'); // curl_setopt($handle, CURLOPT_POSTFIELDS , "gender=M"); curl_setopt($handle,CURLOPT_PROXY , $proxyUrl); curl_setopt($handle,CURLOPT_PROXYUSERPWD , $urlProxyUserPwd); echo curl_exec($handle); 
+6
source share
2 answers

Do you always send requests to a specific server, or does this always happen for different servers?

It is possible that the requested proxy requires data to be sent using the POST method instead of the GET method.

If you could provide us with more information, perhaps some error log, we could help.

0
source

If you get an error message Failed to get feed: cURL error 56: Recv error: reset connection on peers when processing channels, this is due to closing the network connection, while your script is trying to get a response from the remote server.

Can you increase the server-side latency (if the server is urs)?

0
source

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


All Articles