If you first get a connection and then a connection closed message this
might have to do with the webserver being in a segment with a firewall in
between ... possible ?
Otherwise this could simply tell you that the telnet service is NOT running
hence the webserver might be down ?
Just some guesses, but i figure you're not unaware of those issue, could be
worth mentioning.
Cya,
Joris
-----Original Message-----
From: Marek Wojcik [mailto:[EMAIL PROTECTED]]
Sent: woensdag 28 maart 2001 0:06
To: Active State Perl (E-mail)
Subject: Re: Perl Socket/WWW Challenge
----- Original Message -----
From: "Paul Maine Jr." <[EMAIL PROTECTED]>
To: "Active State Perl (E-mail)" <[EMAIL PROTECTED]>
Sent: Tuesday, March 27, 2001 11:37 PM
Subject: Perl Socket/WWW Challenge
> I am using Perl to create a socket connection to a web server. I issue the
> following command to a web server:
> GET / HTTP/1.0
>
> This command works fine on several of my web servers however, when I try
the
> same script on one web server - I get the following result.
>
> Connection closed by foreign host.
>
> I tried the same thing by telnetting into port 80 at a particular IP
> address. The connection closed error is returned by telnet. Any ideas on
> what the problem might be?
Maybe try to send "Host" or "User-Agent" header:
GET / HTTP/1.0
Host: www.some-host.org
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
Have you considered using LWP or LWP::Simple module?
You can do something like this with them:
#!/usr/bin/perl
use LWP::Simple;
my $Index = get(http://www.some-host.org/);
--
Marek Wojcik
[EMAIL PROTECTED]
Ëb½ãÞ®YsSX§'X¬´-S÷�z¹eSËlz»Àrدy+Zµç(sm§ÿåSËlz»Àrدy+Zµç(>ùsSYsYùb²Ø§~�Úr
دz-«
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl