Answer the question
In order to leave comments, you need to log in
How to make cUrl proxy request with authorization?
<?php
function getContent ($url) {
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)");
curl_setopt($curl, CURLOPT_TIMEOUT, 15);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($curl, CURLOPT_PROXY, "94.252.60.10:3128");
curl_setopt($curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
//curl_setopt ($curl, CURLOPT_PROXYUSERPWD, "gzi1wox:mncu9k1g");
curl_setopt ($curl, CURLOPT_HEADER, 1);
$r = curl_exec($curl);
curl_close($curl);
return $r;
}
$content = getContent('http://getip.social/');
echo $content;
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question