Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl Proxy

Status
Not open for further replies.

Thorne44

Programmer
Oct 19, 2005
7
0
0
JP
Hi

I'm using simple script to allow a site to go and fetch it's content from another site and display it as it's own but I'd like the script to pass it's ENV varibles to original site so that site can log it properly.

I'm currently passing cookies already but I lose the IP address, browser, refering URL and all the other logged fields.

I was hoping the env_proxy command would fix it but it doesn't.

$ua = new LWP::UserAgent;
$ua->env_proxy;
$ua->cookie_jar($cookie_pak);
($res) = $ua->request($req);

Any help would be appreciated.

Thanks
Bruce
 
You can't influence most of the ENV variables at the other end - things like REMOTE_IP would be seriously open for abuse if it wasn't set automatically to the peer address. This probably breaks their logging.

One alternative is to use iframes, setting the source to a URL on the remote server. The end user gets to see the content in your context and the remote server get's to see who really wants the data. As a bonus, the traffic doesn't pass via your site, improving performance.

Yours,

fish

["]As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs.["]
--Maur
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top