[squid-dev] ICAP REQMOD request and response structure expectations?

Eliezer Croitoru eliezer at ngtech.co.il
Tue Sep 29 11:47:05 UTC 2015


On 29/09/2015 13:16, Amos Jeffries wrote:
>
>> >or what response does it expects?
> For #1 case, to make it transparent you have to filter the response
> headers. Anything like Location, Content-Location, Forwarded-For which
> contains URL or portions of it.
>
> Also the payload - any content object that might contain URLs. HTML, JS,
> JSON are the worst. But also PS, PDF, images, videos SWF etc.
>
> If any of those get through on reponses there is a chance the user or
> some automated script might use it. What that chance is varies from
> large to ignorable depending on the format type and what the client
> software is.
>
>
> Sorry. Content adaptation is complex if you plan to do it seriously.

Well it is complex but for now I intend to to implement only REQMOD and 
to implement two or three things which will not touch the body.
I cut it down to only two cases which in any case will not touch the 
body for now.
I do also think that the best way is to use some kind of 30X redirection 
instead of altering the request leaving aside that it simplifies things 
for me.

>
>> >Does squid expect me to change the URI only in the request first line or
>> >also the Host header?
> Yes, both.
>
This answers the question.

>> >
>> >It is not a "critical" question since for now I replace them both, but
>> >if squid expects only the URI in the first request line to be changed
>> >there is no point to change the Host header.
> See above. But you may not want to tie this behaviour to depend on
> Squid. ICAP is by design portable between proxies and other types of
> ICAP clients.
Well you are right, but I do not see other proxies using my ICAP 
service(not being negative) and also I cannot really anticipate how they 
will act.
There are only couple cases that might appear which are mentioned in the 
RFC and clears things up.

>> >
>> >Thanks In Advance,
>> >Eliezer
>> >
>> >* I am trying to think about documenting couple things about ICAP in the
>> >WIKI with an example ICAP service.
> Our wiki is probably not the best place. Unless you were just
> concentrating on the squid.conf parts, and AFAICS that is covered already.
>
> You might want to get in contact with Christos about improving c-icap
> documentation or the ICAP forum for adding to their docs for the service
> internals or how-to documentation.
I am not using c-icap and I will probably wont use it due to my 
preference of other languages then C and C++.
But it seems like the ICAP forum is the place to start.

Thanks,
Eliezer

* The ICAP service I wrote is far from complete but it works pretty fast 
in REQMOD for url inspection. I do want to expand it to be able to 
return StoreID but it is totally depends the squid side for now.


More information about the squid-dev mailing list