iamsteve has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use LWP::UserAgent; use HTTP::Headers; my $theurl = "http://www.foo.com"; $h = new HTTP::Headers( Content_Type=>'text/html, text/plain, image/*', Accept=>'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, applicat +ion/vnd.hp-hpf, */*', Accept_encoding=>"gzip, deflate", Accept_language=>"en-us", Connection=>"Keep-Alive", remote_addr=>'123.456', ); $ua = LWP::UserAgent->new; $request = HTTP::Request->new(GET => $theurl, $h); $ua->agent("Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Win 9x 4.90 +)"); $response = $ua->request($request); if ($response->is_success) { print "Content-Type: text/html\n\n"; print $response->content; } else { print "Error: " . $response->status_line . "\n"; } );
$request->header('Accept'=> 'text/html','Type' => 'text/html','remote_ +addr'=>'123.456'); print $q->header(-Type=>'text/html',-Accept=>'text/html',-remote_addr= +>'123.456.789');#under $q use CGI of course tried remote_addr, Addr, and REMOTE_ADDR on above
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: setting remote_addr in header so my server IP isn't the address
by mortis (Pilgrim) on Dec 15, 2001 at 02:30 UTC | |
|
Re: setting remote_addr in header so my server IP isn't the address
by Anonymous Monk on Dec 15, 2001 at 03:28 UTC | |
|
Re: setting remote_addr in header so my server IP isn't the address
by iamsteve (Initiate) on Dec 15, 2001 at 04:10 UTC | |
|
Re: setting remote_addr in header so my server IP isn't the address
by Anonymous Monk on Dec 18, 2002 at 05:49 UTC |