| |
|
|
| | Как работать с прокси в пхп.
Скажем есть іпшка проксика і нужно чтобы скрипт зашел на страницу спод етого проксика | |
| |
|
|
| |
|
|
| |
для: Okey
(03.11.2006 в 02:01)
| | | Соединяйтесь при помощи сокетов с Proxy-сервером, передавая в HTTP-заголовке Host URL загружаемого сайта. Подробности в теме по ссылке http://www.softtime.ru/forum/read.php?id_forum=1&id_theme=14326. | |
| |
|
|
| |
|
|
| |
для: Okey
(03.11.2006 в 02:01)
| | | Выкидывает ошыбку
HTTP/1.0 405 Method Not Allowed Content-Type: text/html Allow: GET You are trying to use a node of the CoDeeN CDN Network. Your IP address is not recognized as a valid PlanetLab address, so your access to CoDeeN does not include all HTTP types | |
| |
|
|
| |
|
|
| |
для: Okey
(04.11.2006 в 00:20)
| | | а также
HTTP/1.1 400 Bad Request Date: Fri, 03 Nov 2006 21:20:37 GMT Server: Apache/1.3.36 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.11 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.27 OpenSSL/0.9.7e-p1 Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 149
Bad Request
Your browser sent a request that this server could not understand.
Client sent malformed Host header
-------------------------------------------------------------
$host = "125.214.233.68"; //IP êàêîãî-òî ïðîêñè
$url = "http://ukarpatah.com.ua";
$line = "";
$fp = fsockopen($host, 8080, $errno, $errstr, 60);
if (!$fp) echo "$errstr ($errno)<br />\n";
else
{
$data =
"var=".urlencode("something data")."\r\n\r\n";
$headers = "POST $url HTTP/1.1\r\n";
$headers .= "Host: $url\r\n";
$headers .= "Content-type: application/x-www-form-urlencoded\r\n";
$headers .= "Content-Length: ".strlen($data)."\r\n\r\n";
fwrite($fp, $headers.$data);
while (!feof($fp))
{
$line .= fgets($fp, 1024);
}
fclose($fp);
}
echo $line; | |
| |
|
|
| |
|
|
| |
для: Okey
(04.11.2006 в 00:23)
| | |
<?php
echo("<?xml version='1.0' encoding='UTF-8'?>\n");
?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<title>PROXY</title>
</head>
<body>
<?php
$host = "125.214.233.68"; //IP какого-то прокси
$url = "http://www.mail.ru/";
$line = "";
$fp = fsockopen($host, 8080, $errno, $errstr, 30);
if (!$fp) echo "$errstr ($errno)<br />\n";
else
{
$data = "var=".urlencode("something data")."\r\n\r\n";
$headers = "POST $url HTTP/1.1\r\n";
$headers .= "Host: $host\r\n";
$headers .= "Content-type: application/x-www-form-urlencoded\r\n";
$headers .= "Content-Length: ".strlen($data)."\r\n\r\n";
fwrite($fp, $headers.$data);
while (!feof($fp))
{
$line .= fgets($fp, 1024);
}
fclose($fp);
}
echo "<pre>\n".$line."</pre>\n";
?>
</body>
</html>
|
HTTP/1.1 200 OK
Date: Fri, 03 Nov 2006 21:50:40 GMT
Server: Apache/1.3.31 (Unix) mod_deflate/1.0.21 rus/PL30.20
Set-Cookie: Mpopl=1063641051; expires=Fri, 03 Nov 2006 22:05:40 GMT; path=/; domain=.233.68
Set-Cookie: mrcu=BF44454BB9B0636A00EA44E9D67D; expires=Tue, 29 Jul 2036 20:52:05 GMT; path=/; domain=.233.68
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Last-Modified: Tue, 29 Jul 2036 20:52:05 GMT
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=windows-1251
Vary: user-agent
Все OK... | |
| |
|
|