Próbáld meg SOCKET el.
PHP kód:
<?php
$host = '23.321.111.111';
$path = '/valami.js';
$pass = base64_encode('user:pass');
$port = '10000';
$fp = fsockopen($host, $port, $errno, $errstr, 30);
$nl = "\r\n";
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = 'GET '.$path.' HTTP/1.1'.$nl;
$out .= 'Host: '.$host.$nl;
$out .= 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0'.$nl;
$out .= 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'.$nl;
$out .= 'Accept-Language: en-us,en;q=0.5'.$nl;
$out .= 'Accept-Encoding: gzip, deflate'.$nl;
$out .= 'Connection: keep-alive '.$nl;
$out .= 'Authorization: Basic '.$pass.$nl.$nl;
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
?>
Könyvjelzők