我正在使用云服务器Ubuntu 12.04作为用于网页抓取的tor代理服务器。目前遇到的问题是显示错误信息:
HTTP/1.0 501 Tor不是HTTP代理服务器Content-Type: text/html; charset=iso-8859-1
HTTP/1.0 501 Tor不是HTTP代理服务器Content-Type: text/html; charset=iso-8859-1
$url = 'http://whatismyipaddress.com';
$agent= 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)';
$ch = curl_init('http://whatismyipaddress.com');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXY, 'https://127.0.01:9050/');
curl_exec($ch);
curl_close($ch);
$result=curl_exec($ch);
我需要帮助找出问题所在。 我已经尝试使用
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
当请求正在加载且会话过期但没有结果时。