CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
IO:SOCKET

 



entius
stranger

Sep 18, 2002, 7:11 AM

Post #1 of 3 (1008 views)
IO:SOCKET Can't Post

i have this code:

#!/usr/bin/perl -w
use IO::Socket qw(:DEFAULT :crlf);
$host = 'projecte.relatiu.com:http(80)';
$path = '/';
$socket = IO::Socket::INET->new(PeerAddr,$host);
print $socket "GET $path HTTP/1.0 \n\n";
$response = <$socket>;
print "$response\n\n\n";
print $data while read($socket,$data,1024) > 0;

With this i egt the server, i read the web page, but i have a "deep" problem:
My server, relatiu.com, have www.relatiu.com, fuagras.relatius.com, and projecte.relatiu.com.

I have modified the etc/hosts to allow my konqueror/mozilla to get into the server (inside the lan). I put in the host that x.relatiu.com is the ip 172.26.0.4, ok, no problem, if i ask for projecte.relatiu.com i get projecte.relatiu.com.

But when i run the script written before, even if i ask for projecte.relatiu.com or yyy.relatiu.com always i am getting www.relatiu.com ($ENV{SERVER_NAME} is www.relatiu.com).

WHAT CAN I DO???? i really don't know, i run the script from CRON, so the %ENV of there is not the cgi ENV (there's no SERVER_NAME).

WHAT CAN I DO ???
blogum


entius
stranger

Sep 18, 2002, 12:06 PM

Post #2 of 3 (1005 views)
Re: [entius] IO:SOCKET [In reply to] Can't Post

So the problem is this: perl SOCKET lose the server_name projecte.relatiu.com because it always appears (with all xxx.relatiu.com) as www.relatiu.com.

Is it really a Socket module perl problem???
blogum


entius
stranger

Sep 18, 2002, 12:20 PM

Post #3 of 3 (1004 views)
Re: [entius] IO:SOCKET [In reply to] Can't Post

ok I?VE found!!!! only (i guess) a bug in http 1.0, solved with http 1.1 (it works with http 1.1)
blogum

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives