Let's try to understand the message flow between Squid and the redirector (or rewriter) programs.
A line containing the fields shown previously (separated by spaces) is passed by Squid to the URL redirector program using a single line for each client request. Once the helper program has finished processing the fields, it must write one of the following messages on the standard output. Please note that the new line (\n) at the end of the message is important and must not be omitted:
The line containing the fields is read by the URL redirector program from the standard input.
After reading the line from the standard input, the redirector (or rewriter) program can process the fields and make decisions based on the values of different fields.
A line containing only the identifier (
ID \n
).A modified URL with an HTTP redirect code followed by a new line.
(
ID 3XX:URL \n
). The HTTP redirect code and the URL should be separated...