|
ru.cgi.perl- RU.CGI.PERL ------------------------------------------------------------------ From : Sergiy Toropov 2:5020/400 26 May 2001 19:23:09 To : All Subject : передача пароля при ауторизации -------------------------------------------------------------------------------- Привет всем. Скрипт лежит в директории требующей ауторизацию. Имеется такой скрипт: #!/usr/bin/perl use IO::Socket; $host = "ip.for.something.host"; $EOL = "\015\012"; $BLANK = $EOL x 2; $document="/cgi-bin/test"; $remote = IO::Socket::INET->new( Proto => "tcp", PeerAddr => $host, PeerPort => "http(80)", ); unless ($remote) { die "cannot connect to http daemon on $host" } $remote->autoflush(1); print $remote " $document HTTP/1.0" .$EOL; print $remote "Host: something.ru" .$EOL; print $remote "Auth_type: basic" .$EOL; print $remote "Remote_user: test" .$EOL; print $remote "User-Agent: Mozilla/4.04 [en] (Win95; I)" .$EOL; print $remote "Referer: http://something_for_referer.ru/".$EOL; print $remote "X-forwarded-for: something_for_proxy" .$BLANK; while ( <$remote> ) { $res=$_; print "$res\n"; } close $remote; Хотелось бы в stdout получить результат работы cgi-bin/test, но сделать этого не могу, потому как не могу передать пароль. Как это сделать? Спасибо. Сергей. --- ifmail v.2.15dev5 * Origin: Barents Centre (2:5020/400) Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.cgi.perl/15399db581a7.html, оценка из 5, голосов 10
|