Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have setup our network as per the tutorial here: https://help.ubuntu.com/community/Upside-Down-TernetHowTo. Basically, we have a squid proxy that inverts images for pages that clients request.

We're trying to modify the script so that we can edit the contents of the webpage before the webpage is sent to the client. We are not having any luck. I'm wondering if there is something different about .html files that makes this not possible.

What is happening is that we do a wget on the URI that is requested, save it locally, modify it and then echo back the new URI. The page that the user gets is the unmodified page and not the one that we just changed.

share|improve this question
    
Have you tried echoing back the modified content? i remember doing the whole proxy mogrification thing on images for an April fools day joke but can't remember if it sent back the image url or the content. –  Aaron Tate Mar 24 '10 at 8:14
1  
The link contains a dot that breaks it. Correct Link: help.ubuntu.com/community/Upside-Down-TernetHowTo –  chiborg Oct 16 '12 at 13:07

2 Answers 2

up vote 0 down vote accepted

From the info you've provided, it sounds like you might be best served with something like sqirm. It's a specifically designed program to interact with squid via url_rewrite_program and is probably better than re-inventing the wheel with you're own perl/bash script.

If you still want to do it manually, theres this:

http://www.visolve.com/squid/squid26/externalsupport.php#url_rewrite_program

share|improve this answer
    
Hey. From the info you've provided, it sounds like you haven't read anything about the question. He wanna put new content to the requested webpage content before send it back. –  erm3nda May 27 at 6:32

Seems not easy. Please check that http://squid-web-proxy-cache.1019090.n4.nabble.com/Question-in-adding-banner-for-ads-by-squid-td4664976.html and that https://answers.launchpad.net/ecap/+faq/1793

On the Glyple webproxy it's just easy, and it'd done by PHP or adding it from it's configuration page.

Anyway, i think Glype has not full capabilities like squid.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.