[squid-dev] Online Translator interface for Squid
Alex Rousskov
rousskov at measurement-factory.com
Thu Sep 14 05:50:28 UTC 2017
On 09/13/2017 11:25 PM, Jeffrey Merkey wrote:
> It will allow me to translate any web content read through such a
> cache to downstream clients. I need to know where to hook into your
> cache at the layer it is reading html pages to insert the translator.
Hello Jeffrey,
You should not hook this inside Squid. Implement an ICAP or eCAP
service instead: http://wiki.squid-cache.org/SquidFaq/ContentAdaptation
> Is there a neat and clean interface where I can get the pages being
> read from the cache, and translate them, then send them to the
> downstream clients.
Not really. Squid does not even have a concept of a "page"; it operates
on the level of HTTP messages. Adaptation services also have to work
with HTTP messages, not pages, but at least you will not have to deal
with Squid code (changes). As an added bonus, your service will work
with any proxy that supports ICAP (most production proxies do) or eCAP
(I am not aware of any production proxy that does, but that may change).
Please note that due to the "success" of the "TLS everywhere" campaign,
you will most likely have to attack and bump user TLS traffic in order
to translate most pages on the fly. This opens up a big can of worms.
http://wiki.squid-cache.org/Features/SslPeekAndSplice
At the end of the day, you may want to write browser plugins instead,
although that option also comes with its own set of serious problems. In
theory, you can even write a browser plugin that will talk to an ICAP or
eCAP service, so that you can cover all possible deployment vectors with
a single adaptation service, but that is even more work, and I have not
heard of anybody doing that.
HTH,
Alex.
More information about the squid-dev
mailing list