Re: [squid-users] Strange problem with Monkey HTTP Daemon, Squid 3 and localhost

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Thu, 07 Oct 2010 00:25:44 +1300

On 07/10/10 00:08, Simón wrote:
> El 06/10/10 01:42, Amos Jeffries escribió:
>
<snip>
>>> I have cleared the Squid cache with:
>>> ——————————————————————————————
>>>
>>> sudo service squid stop
>>> sudo rm -Rf /var/cache/squid/*
>>> sudo squid -z
>>> sudo service squid start
>>>
>>> ——————————————————————————————
>>> But it still works without webserver!
>>> After, I have reset the PC (disabling "Monkey HTTP Daemon" start) and
>>> Squid still works with Bannerfilter but without webserver!
>>> Moreover, I have modified several HTML files, in directory containing
>>> the HTML and graphics files of Bannerfilter, but Squid shows the old
>> files!
>>> I don't understand nothing. How can be this possible!?
>> web browser cache?
> No, it was cleared too. It's cleared every time that I close the browser.
>> You are running "Monkey HTTP Daemon" on your web browser local host?
> Yes, everything (squid, webserver, browser, etc...) is in the same PC.
>>> By other hand, I can't access to localhost directly from browser (with
>>> or without "Monkey HTTP Daemon").
>> Of course. You are using a "transparent" interception proxy. "localhost"
>> and "127.0.0.1" and "[::1]" in the browser address bar on these setups
>> means the machine your browser runs on
> Ok, but it's the same machine.
>> They only ever mean the proxy machine when the browser is configured to
>> pass requests to the proxy. Without performing it's own DNS on the URI
>> which would resolve them to itself.
> I don't understand this at all (sorry, my english isn't very good).
>
> My questions:
> 1) How can Squid serves objects (images, html pages, etc...) from
> http://localhost if there isn't any webserver running?

Answer is simple. Without existing cache content it can't. So after that
rm + squid -z there *has* to be something running.

Since you are doing URL re-write instead of HTTP redirect your Squid log
should contain DIRECT/*.*.*.* with the IP address it fetched from. Check
that its localhost or 127.0.0.1 etc.

netstat on your machine will display whether the HTTP server really has
stopped or not.

> 2) Why the browser can't access directly to the webserver (when the
> webserver is up)? This question isn't very important, it's only curiosity.

Since you have the on the same machine the browser can normally get
anywhere Squid can. Maybe your NAT rules doing the interception are
different for each app.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.8
   Beta testers wanted for 3.2.0.2
Received on Wed Oct 06 2010 - 11:25:50 MDT

This archive was generated by hypermail 2.2.0 : Wed Oct 06 2010 - 12:00:02 MDT