Discussion:
[squid-users] content adaptation using squid
Yosef Meltser
2018-09-06 06:06:48 UTC
Permalink
Hi,


We have managed to create a proxy server using a squid in an intercept mode.

Now we would like to make a content adaptation, for example to show an alert
every time the user entered a website.

We are not familiar with this domain, so we are looking for the easiest way
to inject java script in the http response (of course only http sites).

The main two adaptation mechanisms are:

1. Icap

2. Ecap

For example, in Icap there are some server frameworks that we can use (like
c-icap, ICAP-server and etc and etc), which one is the most recommended?

In contrast to the above, ECAP is not using any server, and the whole
process in embedded into the squid, so it sounds quite easier. Is it?

Thank you in advance.



--
Sent from: http://squid-web-proxy-cache.1019090.n4.nabble.com/Squid-Users-f1019091.html
Amos Jeffries
2018-09-06 14:10:58 UTC
Permalink
Post by Yosef Meltser
Hi,
We have managed to create a proxy server using a squid in an intercept mode.
Now we would like to make a content adaptation, for example to show an alert
every time the user entered a website.
We are not familiar with this domain, so we are looking for the easiest way
to inject java script in the http response (of course only http sites).
Simply put. Do not do that.

Please be aware that despite the content HTTP transferring being public
it is still under copyright by the authors who created it and/or the
owners of the domain where it is fetched from. They have implicitly
granted rights only to *view* and distribute the content as-is.

Please check with your legal department about the consequences of
altering copyright content without the copyright holders permission. The
Berne Convention copyright treaty forbidding this type of "piracy"
covers most countries, and the remainder usually have even more harsh
laws of their own.


A much better approach is a "splash page" - to have your proxy respond
with a 302 redirect to a page containing your message, and a
click-through link (or iframe, if that works) to the actual content.
That way the external content remains separate from your content and
everything is good.
The traditional session splash page details can be found at
<https://wiki.squid-cache.org/ConfigExamples/Portal/Splash>.
If you have existing system to manage when the messages are to be
displayed you may want the database session helper instead
<http://www.squid-cache.org/Versions/v4/manuals/ext_sql_session_acl.html> which
works from externally managed details in an SQL database.
Post by Yosef Meltser
1. Icap
2. Ecap
For example, in Icap there are some server frameworks that we can use (like
c-icap, ICAP-server and etc and etc), which one is the most recommended?
In contrast to the above, ECAP is not using any server, and the whole
process in embedded into the squid, so it sounds quite easier. Is it?
Neither is more easy or more difficult than the other. They are just
different ways to receive the traffic.


Amos
Alex Rousskov
2018-09-06 16:46:10 UTC
Permalink
Post by Yosef Meltser
Now we would like to make a content adaptation, for example to show an alert
every time the user entered a website.
If you have not already, please familiarize yourself with the content
adaptation problems. The following FAQ entry is a good starting point:
https://answers.launchpad.net/ecap/+faq/1793

Splash pages (mentioned by Amos) can be a form of content adaptation and
several problems in the above FAQ entry apply to them as well.
Post by Yosef Meltser
For example, in Icap there are some server frameworks that we can use (like
c-icap, ICAP-server and etc and etc), which one is the most recommended?
There is no general winner AFAICT. All servers have their pros and cons
(cost, ease of management, performance, ease of modification, quality of
support, licensing restrictions, etc.). Use whatever works best for your
needs. For example, the server you use for prototyping may differ from
the server you use as a long-term solution.
Post by Yosef Meltser
In contrast to the above, ECAP is not using any server, and the whole
process in embedded into the squid, so it sounds quite easier. Is it?
Overall, there is no drastic complexity difference between

* embedding your code into an ECAP-capable host like Squid and
* embedding your code into an ICAP server like c-icap.

In some cases, even the APIs are going to be similar! Some ICAP servers
are probably easier to work with than eCAP, and some are probably more
cumbersome, but you are doing the same work on the conceptual level --
writing a "plugin" where your adaptation code/logic lives.

An ICAP server introduces an additional stand-alone service/software
that you have to take care of, of course.

Needless to say, writing an eCAP adapter is much easier than writing a
(good) ICAP server -- writing an ICAP server from scratch is usually the
wrong answer.


HTH,

Alex.
Eliezer Croitoru
2018-09-07 09:29:28 UTC
Permalink
The list of the known ICAP servers that I can list are:
- https://github.com/elico/icap
- https://github.com/jburnim/GreasySpoon
- c-icap
- echelon-mod (Which I wrote from 0 but is not public)
- https://github.com/elico/drbl-icap-service

I wrote both eCAP and ICAP services/modules code and I found it very easy to start with an ICAP service.
Then and only if the ICAP service seems to make sense and works as expected try to asses either:
- eCAP module
- Proxy Service
- Other creative idea

I have worked couple years ago on a tproxy based p2p caching software but eventually erased the code...
It's nice to have some cash from cache but I like my green/white hat rather then the black one.

All The Bests,
Eliezer

----
Eliezer Croitoru
Linux System Administrator
Mobile: +972-5-28704261
Email: ***@ngtech.co.il


-----Original Message-----
From: squid-users [mailto:squid-users-***@lists.squid-cache.org] On Behalf Of Alex Rousskov
Sent: Thursday, September 6, 2018 7:46 PM
To: squid-***@lists.squid-cache.org
Subject: Re: [squid-users] content adaptation using squid

On 09/06/2018 12:06 AM, Yosef Meltser wrote:

<SNIP>
Post by Yosef Meltser
In contrast to the above, ECAP is not using any server, and the whole
process in embedded into the squid, so it sounds quite easier. Is it?
Overall, there is no drastic complexity difference between

* embedding your code into an ECAP-capable host like Squid and
* embedding your code into an ICAP server like c-icap.

In some cases, even the APIs are going to be similar! Some ICAP servers
are probably easier to work with than eCAP, and some are probably more
cumbersome, but you are doing the same work on the conceptual level --
writing a "plugin" where your adaptation code/logic lives.

An ICAP server introduces an additional stand-alone service/software
that you have to take care of, of course.

Needless to say, writing an eCAP adapter is much easier than writing a
(good) ICAP server -- writing an ICAP server from scratch is usually the
wrong answer.


HTH,

Alex.
_______________________________________________
squid-users mailing list
squid-***@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users

Loading...