Re: fsockopen via MS-Proxy authentification
| From: | Todd Williamsen | Date: | Tue, 12 Feb 2002 19:26:26 +0000 |
| Subject: | Re: fsockopen via MS-Proxy authentification | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-12037@lists.php.net to get a copy of this message | ||
You are attempting to access the web port directly, is that the actual port
of the proxy server?
Try using the proxy server port #
"Kriegers Horst" <Horst.Kriegers@Sport-Toto.ch> wrote in message
news:1B37564CB0DDD111824D0000F8D05FAF0120EE5C@mail_srv_01.stg.swiss...
> Hi all,
>
> I wish to fetch an internet web page.
> Oour internet access is through MS-Proxy server 2.0 with NTLM
> authentification (domain\user:password).
> I experience an access probleme.
>
> Here you are the result:
> proxy_srv_01:80 is available
> HTTP/1.0 407 Proxy Access Denied Server: Microsoft-IIS/3.0 Date: Fri, 08
Feb
> 2002 08:15:35 GMT Proxy-Authenticate: NTLM Proxy-Authenticate: Basic
> realm="proxy_srv_01.stg.swiss"
>
>
> Here you are my code:
>
> <?
> $user="lnt_01\test"; // DomainNT\UserName
> $pass="test"; // UserPassword
>
>
> $proxy_s = "proxy_srv_01"; // Proxy server to Internet
> $proxy_p = "80"; // Proxy port
>
> $myfiles = "http://www.phpscripts-fr.net"; // URL to
> fetch
>
> $datei = fsockopen($proxy_s, $proxy_p, &$errno,&$errstr, 30);
>
> if( !$datei )
> {
> echo "<font color=red><b>$proxy_s:$proxy_p isn't available
> !</b></font>";
> exit();
> } else {
> echo "<font color=green><b>$proxy_s:$proxy_p is
> available</b></font><br>";
> fputs($datei,"GET $myfiles/ HTTP/1.0 \r\n\r\n");
>
> while (!feof($datei))
> {
> echo $zeile = fread($datei,1000);
> }
> }
> ?>
>
> Is something erroneous in my code?
>
> If somebody can help me, I will be really happy
> Thanks
>
> Horst
>