简体   繁体   中英

Proxy URL redirection using perl

I want to Do a proxy redirect from perl. I have been using Location Header to redirect.

    print ("Location: http://www.example.com\n");

The problem with this is the url on the client side changes to a new one (ie www.example.com ). I don't want that to happen, so that the end user is unaware of the location we are serving the request from.

If the client is going to do the fetching, it's going to show the URL it's fetching unless the page being fetched is embedded in another page (eg by using an iframe). And even then, it's very easy for the user to discover the url if they look.

If instead you do want to a be a proxy (and by all indication you are), which is to say you want to fetch a doc and return it to the client, well, you have to start by fetching the doc you want to return to the client.

Note that you can configure apache to act as a proxy .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM