Mailinglisten-Archive |
> $myfiles =
> "http://www.xyz.com/cgi-bin/plz_suche/search_or.cgi?or_plz=$PLZ&or_ort=".raw
> urlencode($stadt
> <http://www.xyz.com/cgi-bin/plz_suche/search_or.cgi?or_plz=$PLZ&or_ort=>);
>
> $datei = fsockopen("proxy.wdf.sap-ag.de", 8080, &$errno,
> &$errstr);
> if( !$datei )
> {
> echo "proxy not available !";
> fclose($resultfile);
> exit();
> } else {
> fputs($datei,"GET $myfiles/ HTTP/1.0\n\n");
> while (!feof($datei))
> {
> $zeile = fgets($datei,1000);
> }
> }
>
>
> Tja, da bleibt dann noch das Problem mit der Authentifizierung.
> Folgendes habe ich in Perl gemacht, sollte sich aber auch auf
> PHP übertragen lassen:
>
> (Quelle: Perl-Modul
> http://search.cpan.org/doc/RWAHBY/Net-HTTPTunnel-0.3/HTTPTunnel.pm )
>
> # the CONNECT method itself
> $connectmsg = 'CONNECT ' . $args{'remote-host'} . ':' .
> $args{'remote-port'} . ' HTTP/' . $args{'http-ver'} . "\015\012";
>
> # if we're not 1.0, presumably we're >1.0, in which case we need to send
> # the Host: header. It doesn't really make sense to use a different version
> # unless the proxy requires it for some reason---once the connection is
> made,
> # there's no difference at all
> if ($args{'http-ver'} ne '1.0')
> {
> $connectmsg .= 'Host: ' . $args{'proxy-host'} . ':' .
> $args{'proxy-port'} . "\015\012";
> }
>
> # if we're going to do proxy authentication, we don't even need to wait for
> the
> # 407---just send them the first time
> if ($args{'proxy-user'} && $args{'proxy-pass'})
> {
> $upstr = $args{'proxy-user'} . ':' . $args{'proxy-pass'};
> $passstr = MIME::Base64::encode($upstr, '');
>
> $connectmsg .= 'Proxy-Authorization: Basic ' . $passstr .
> "\015\012";
> }
>
> Das sollte sich passend kombinieren lassen....
Meinst Du nun, dass auf PHP umschreiben oder PHP mit Perl zusammen kombinieren. (Oje, Oje nun auch noch Perl lernen ;-))
Auf jeden Fall sieht das schon ganz treffend aus.
Dankeschöön
Matthias
php::bar PHP Wiki - Listenarchive