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

Eliezer Croitoru eliezer at ngtech.co.il
Mon Sep 28 23:57:36 UTC 2015


I have been working on an ICAP service and eventually I found out that 
some of the issues I have been struggling to resolve are just there 
because the library implementer partially read the RFC or just not fully 
considered the code he was writing.

So after reading the ICAP RFC(who knows what time) I found out that 
squid obeys it but it seems to alter the requests a bit.
So I wanted to verify as much as possible I understand correctly what is 
possible.
For HTTP requests squid seems to replace the original request first line 
PATH to a full URI.
I have tried couple times to verify and this is how it works..
I remember that there might have been an RFC that allows the usage of a 
full url in the path of the Request first line and I know but it is 
supported by many web servers.

So would it be expected to be always like that in squid? since it 
applies to tproxy and forward proxy mode I assume it will be the same 
for everything else including reverse proxy mode.
Another case is the CONNECT method, there I know that in a forward proxy 
mode a URI is not being used in the path but a domain\ip:port is there 
always.

Now to the main question:
In a case I would modify a request to perform a url rewrite like 
operation, which is to replace url_rewrite helper I can do one of two 
things.
- I can either modify the full request and transparently send the client 
to another page.
- or use the same request and append a response such as 302 or 307 
redirection.

The second case is simple to implement but the first one(changing the 
original request) means that I am changing the URL, but what squid 
expects me to change in the request? or what response does it expects?
Does squid expect me to change the URI only in the request first line or 
also the Host header?

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.

Thanks In Advance,
Eliezer

* I am trying to think about documenting couple things about ICAP in the 
WIKI with an example ICAP service.


More information about the squid-dev mailing list