
entius
stranger
Sep 18, 2002, 7:11 AM
Post #1 of 3
(751 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
|