clevel
Новичок
HTTP/1.0 400 Bad Request
хочу получить контент через сокеты:
в отчет получаю:
HTTP/1.0 400 Bad Request Content-Type: text/html You are trying to use a node of the CoDeeN CDN Network. While the Host header is generally optional for HTTP, it is required for CoDeeN. Furthermore, numerical hostnames are not allowed. Please add this header and try again.
Чего не правильно ему подсунул?
Массив проксей вот:
$proxies=array("12.107.108.211",8000,
"12.124.242.78",8080,
"12.124.242.78",8081,
"12.135.229.194",8080,
"12.15.46.21",8000,
//"12.154.34.81",80, //ok
"12.166.80.122",80,
"12.208.132.88",80,
"12.32.88.30",80,
"12.44.38.129",8081,
"12.44.87.173",8000,
"12.96.218.205",80,
"128.84.154.49",3128,
"129.186.47.38",8000,
"129.237.123.250",3128,
"134.169.9.108",80);
Если раскоментировать проксю, то выдает:
HTTP/1.0 400 Malformed URL Proxy-agent: Netscape-Proxy/3.52 Date: Mon, 08 Dec 2003 23:38:35 GMT Content-type: text/html Content-length: 157
хочу получить контент через сокеты:
PHP:
for($i=0;$i<sizeof($proxies);$i=$i+2){
$fp=fsockopen($proxies[$i],$proxies[$i+1], $errno, $errstr, 5);
if(!$fp){echo "i|$i| proxy|".$proxies[$i]."|error_str|$errstr| ($errno)<br>\n";}
else{
fputs($fp, "GET [url]www.geobytes.com/IpLocator.htm[/url] HTTP/1.0\r\nHost:geobytes.com\r\n\r\n");
fputs($fp, "Content-Type: application/x-www-form-urlencoded"."\r\n");
fputs($fp, "Connection: Close\r\n");
fputs($fp, "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)\r\n");
$data="GetLocation&cid=0&c=0&Template=".urlencode("iplocator.htm")."&ipaddress=".urlencode("195.131.98.204");
fputs($fp,"Content-length: ".strlen($data)."\r\n");
fputs($fp,"Accept: */*\r\n");
fputs($fp,"\r\n");
fputs($fp,"$data\r\n");
fputs($fp,"\r\n");
while($str=fgets($fp,1024)) echo $str;
fclose ($fp);
break;
} //else
} //for i
HTTP/1.0 400 Bad Request Content-Type: text/html You are trying to use a node of the CoDeeN CDN Network. While the Host header is generally optional for HTTP, it is required for CoDeeN. Furthermore, numerical hostnames are not allowed. Please add this header and try again.
Чего не правильно ему подсунул?
Массив проксей вот:
$proxies=array("12.107.108.211",8000,
"12.124.242.78",8080,
"12.124.242.78",8081,
"12.135.229.194",8080,
"12.15.46.21",8000,
//"12.154.34.81",80, //ok
"12.166.80.122",80,
"12.208.132.88",80,
"12.32.88.30",80,
"12.44.38.129",8081,
"12.44.87.173",8000,
"12.96.218.205",80,
"128.84.154.49",3128,
"129.186.47.38",8000,
"129.237.123.250",3128,
"134.169.9.108",80);
Если раскоментировать проксю, то выдает:
HTTP/1.0 400 Malformed URL Proxy-agent: Netscape-Proxy/3.52 Date: Mon, 08 Dec 2003 23:38:35 GMT Content-type: text/html Content-length: 157