P
Public Interest
i am trying to use proxy 64.161.246.100:8080
original code without proxy:
use Net::HTTP;
#
my $s = Net::HTTP->new(Host => 'quote.yahoo.com') || die $@;
$s->write_request(GET => 'http://quote.yahoo.com', 'User-Agent' =>
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)' );
my($code, $mess, %h) = $s->read_response_headers;
print %h;
$location=$h{'Location'} ;
print $location;
it find that the location is http://finance.yahoo.com/?
now use it with proxy:
use Net::HTTP;
#
my $s = Net::HTTP->new(Host => '64.161.246.100:8080') || die $@;
$s->write_request(GET => 'http://quote.yahoo.com', 'User-Agent' =>
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)' );
my($code, $mess, %h) = $s->read_response_headers;
print %h;
$location=$h{'Location'} ;
print $location;
in the header, it shows no location
I tested the proxy in IE, it works fine when I typed http://quote.yahoo.com
and it forwards me to http://finance.yahoo.com/? So that means the proxy is
set up perfectly handling header Location. One other strainge thing is when
I try to use the script to hit my own server, my server log file does not
even show the hit which requests the redirect header.
original code without proxy:
use Net::HTTP;
#
my $s = Net::HTTP->new(Host => 'quote.yahoo.com') || die $@;
$s->write_request(GET => 'http://quote.yahoo.com', 'User-Agent' =>
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)' );
my($code, $mess, %h) = $s->read_response_headers;
print %h;
$location=$h{'Location'} ;
print $location;
it find that the location is http://finance.yahoo.com/?
now use it with proxy:
use Net::HTTP;
#
my $s = Net::HTTP->new(Host => '64.161.246.100:8080') || die $@;
$s->write_request(GET => 'http://quote.yahoo.com', 'User-Agent' =>
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)' );
my($code, $mess, %h) = $s->read_response_headers;
print %h;
$location=$h{'Location'} ;
print $location;
in the header, it shows no location
I tested the proxy in IE, it works fine when I typed http://quote.yahoo.com
and it forwards me to http://finance.yahoo.com/? So that means the proxy is
set up perfectly handling header Location. One other strainge thing is when
I try to use the script to hit my own server, my server log file does not
even show the hit which requests the redirect header.