Merhaba aşağıdaki şekilde php-curl proxy bağlantısı yapmaya çalışıyorum fakat bağlantı sağlayamıyorum. Proxy aktif gözüküyor.
Nerede hata yapıyorum acaba?
// curl_setopt($ch, CURLOPT_PROXY, "IPADRESİM");
// curl_setopt($ch, CURLOPT_PROXYPORT, "PORTUM");
// curl_setopt($ch, CURLOPT_PROXYUSERPWD, "kullaniciadi:sifre");
Aşağodaki şekilde kullanıyorum.
<?php
$url = 'https://google.com.tr;
$proxy = 'proxy-ip: port';
$proxyauth = 'proxy-sifre';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyauth);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT,10);
$output = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo 'HTTP code: ' . $httpcode;