5

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.

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
user38400
  • 155
  • 1
  • 2
  • 4
  • 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 08:14
  • 1
    The link contains a dot that breaks it. Correct Link: https://help.ubuntu.com/community/Upside-Down-TernetHowTo – chiborg Oct 16 '12 at 13:07

2 Answers2

1

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.squid-cache.org/Doc/config/url_rewrite_program/

Flimzy
  • 2,375
  • 17
  • 26
Aaron Tate
  • 1,222
  • 7
  • 9
  • 1
    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 06:32
0

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.

m3nda
  • 161
  • 5