We have set up our network as per this tutorial. 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.

  • 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

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:


  • 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. – m3nda May 27 '14 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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