내가 가진 작업 사용자 정의 PHP는 프록시 클래스 => 내가 너무 =>PHP 프록시 더 이상
$proxy = new Proxy("PROXY_IP:PROXY_PORT");
$content = $proxy->get_page($url);
같은 init을 그리고 모든 며칠 전까지 벌금 일하는
class Proxy
{
private $proxy,
$header,
$timeout,
$agent;
public function __construct($proxy, $header = null, $timeout = null, $agent = null) {
$this->proxy = $proxy;
$this->header = empty($header) ? 1 : $header;
$this->timeout = empty($timeout) ? 5 : $timeout;
$this->agent = empty($agent) ? "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8" : $agent;
}
public function set_proxy($proxy) {
$this->proxy = $proxy;
}
public function get_page($url, $referer = "http://www.google.com/") {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, $this->header);
curl_setopt($ch, CURLOPT_PROXY, $this->proxy);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->timeout);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_USERAGENT, $this->agent);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = array();
$result['exe'] = curl_exec($ch);
$result['inf'] = curl_getinfo($ch);
$result['err'] = curl_error($ch);
curl_close($ch);
return $result;
}
}
. 이제 대부분 Received HTTP code 403 from proxy after CONNECT
과 관련된 오류 메시지가 계속 나타납니다. 수정되지 않은 코드가 어떻게 작동을 멈출 수 있는지 전혀 알지 못하기 때문에이 문제를 디버깅하는 방법을 모릅니다.
도움을 주시면 감사하겠습니다. 감사합니다.
EDIT : 403 상태 코드가 무엇을 의미하는지 알고 있습니다. 어떤 프록시를 사용하든 관계없이 403을 사용한다는 의미입니다. 어떤 페이지를 사용해도 문제가 발생하지 않습니다.