Hi,
I've written a basic script below which normally works to grab pages but not from my protected site. Naturally I know the Realm, Username and Password but don't know how to incorporate it into my current program to get access to the pages.
Hope someone out there can help!
Denise
-----------------------------------------------------
#!/usr/bin/perl
&IOSocket;
sub IOSocket{
use IO::Socket;
$method = "GET";
my @f = split(/\//, $input);
$host = " #their domain...
$path = "/their/root/protected"; #protected root etc...
$socket = new IO::Socket::INET( PeerAddr => $host,
PeerPort => 80,
Proto => 'tcp',
Type => SOCK_STREAM, ) or die &printout;
print $socket "$method $path HTTP/1.0\nReferer: $host\n";
print $socket "User-Agent: $ENV{'HTTP_USER_AGENT'}\n\n";
@output = <$socket>;
close ($socket);
}
$FILE="d:/Inetpub/mydomain/file.htm"; #my local domain directory path
open(WRBK,">$FILE"
;
print WRBK "@output\n";
close(WRBK);
exit;
I've written a basic script below which normally works to grab pages but not from my protected site. Naturally I know the Realm, Username and Password but don't know how to incorporate it into my current program to get access to the pages.
Hope someone out there can help!
Denise
-----------------------------------------------------
#!/usr/bin/perl
&IOSocket;
sub IOSocket{
use IO::Socket;
$method = "GET";
my @f = split(/\//, $input);
$host = " #their domain...
$path = "/their/root/protected"; #protected root etc...
$socket = new IO::Socket::INET( PeerAddr => $host,
PeerPort => 80,
Proto => 'tcp',
Type => SOCK_STREAM, ) or die &printout;
print $socket "$method $path HTTP/1.0\nReferer: $host\n";
print $socket "User-Agent: $ENV{'HTTP_USER_AGENT'}\n\n";
@output = <$socket>;
close ($socket);
}
$FILE="d:/Inetpub/mydomain/file.htm"; #my local domain directory path
open(WRBK,">$FILE"
print WRBK "@output\n";
close(WRBK);
exit;