|
|
Question : push header, IP#?
|
|
My question follows the script below:
use HTTP::Request::Common qw(GET); use LWP::UserAgent; my $ua = new LWP::UserAgent; $ua->agent('Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt)'); my $req = GET 'http://www.SomeSite.com/'; $req->push_header(REFERER => 'http://www.ReferringSite.com/'); my $page = $ua->request($req)->as_string;
print $page; exit; -----------------------
Is there a way to not only 'push' a referer, but also push the user's IP number? I do have reason for this. I need to get the user's IP number (I can't find it in my Perl book but I know it's in there) and push the IP number along with the referer. Is there a way to do this? I don't want SomeSite.com to get MY server's IP # everytime the script is run, I want it to get the IP number of the user who is executing the script from my server. Is there some way to do this?? Thank you.
|
Answer : push header, IP#?
|
|
On a lower level of abstraction every HTTP-connection is based on sockets which have source ip and port as well as a destination ip address and port. The server you are connecting to gets your ip address from this low level socket connection.
The referer is not part of this low level behaviour and therefor can be faked. Because you want the ip-packets that contain the answer to arrive at your system, you cannot fake the ip-address...
One way I can think of to archive what you probaly want to to is to simulate proxy behaviour...
|
|
|
|
|