Is there a way to confirm Squid is working?


  • Other than the obvious "Service is running" notification on the Dashboard, is there a simple test that shows Squid is running? I'm running Squid right now (and the learning curve is molasses slow for me!) and have not noticed any "difference" in system performance. I guess I didn't expect much because it's running on a home network but it'd be nice if I could confirm it's configured correctly. I can't even seem to review the "cache" to see if my system is even storing files. Perhaps there's no reason to run Squid at all given it's a home network and should be removed entirely.


  • http://www.whatismyip.com/

    Should indicate whether it detected a proxy or not under your IP.


  • @mhab12:

    http://www.whatismyip.com/

    Should indicate whether it detected a proxy or not under your IP.

    I tried that already and it only shows my HAVP proxy. Does that also indicate Squid is working? I'm really confused about how the two are related.


  • I believe HAVP is just another instance of Squid…looks like you're up and running.  Try disabling HAVP/Squid and revisit the site, won't show anything like that.


  • maybe by activating temporary the squid.log , u can tail it and see it HIT or MISS ….. maybe.....


  • Run```
    #tail -f /var/squid/log/access.log


  • @mhab12:

    Run```
    #tail -f /var/squid/log/access.log

    Great, thanks. There's "stuff" in there but it appears to be from several days ago. I also went to several sites with a client on my LAN and didn't notice anything change on the console after doing so. Hmm…


  • I find that this technique works when I'm trying to find out when I'm behind a transparent proxy…

    pc-bern-host ~ % telnet www.bbc.co.uk 80
    Trying 212.58.251.197…
    Connected to www.bbc.net.uk.
    Escape character is '^]'.
    HEAD http://www.google.co.uk HTTP/1.1
    Host: www.google.co.uk

    HTTP/1.0 200 OK
    Date: Thu, 27 Aug 2009 17:41:02 GMT
    Expires: -1
    Cache-Control: private, max-age=0
    Content-Type: text/html; charset=ISO-8859-1
    Set-Cookie: PREF=ID=1cb5dc1b553c7adc:TM=1251394862:LM=1251394862:S=zCNt-T5gtFSxmMpP; expires=Sat, 27-Aug-2011 17:41:02 GMT; path=/; domain=.google.co.uk
    Server: gws
    X-Cache: MISS from localhost
    Proxy-Connection: close

    Connection closed by foreign host.

    ie. telnet to a known-good webserver on port 80, request a page from a different server and see which of the two replies. If you're being proxied, you'll get the "inner" host replying. If you're not being proxied, your "outer" host will reply.


  • @Bern:

    I find that this technique works when I'm trying to find out when I'm behind a transparent proxy…

    pc-bern-host ~ % telnet www.bbc.co.uk 80
    Trying 212.58.251.197…
    Connected to www.bbc.net.uk.
    Escape character is '^]'.
    HEAD http://www.google.co.uk HTTP/1.1
    Host: www.google.co.uk

    HTTP/1.0 200 OK
    Date: Thu, 27 Aug 2009 17:41:02 GMT
    Expires: -1
    Cache-Control: private, max-age=0
    Content-Type: text/html; charset=ISO-8859-1
    Set-Cookie: PREF=ID=1cb5dc1b553c7adc:TM=1251394862:LM=1251394862:S=zCNt-T5gtFSxmMpP; expires=Sat, 27-Aug-2011 17:41:02 GMT; path=/; domain=.google.co.uk
    Server: gws
    X-Cache: MISS from localhost
    Proxy-Connection: close

    Connection closed by foreign host.

    ie. telnet to a known-good webserver on port 80, request a page from a different server and see which of the two replies. If you're being proxied, you'll get the "inner" host replying. If you're not being proxied, your "outer" host will reply.

    My output just looks like this…

    $ telnet www.bbc.co.uk 80
    Trying 212.58.251.197…
    Connected to www.bbc.net.uk.
    Escape character is '^]'.
    Connection closed by foreign host.

    What'd I do wrong?


  • Incidentally, I'm using a 640GB hard drive on this pfSense box so I have tons of space, if needed. What cache size is recommended? I have it set to 100000 MB (or 100GB).


  • Did you type the "HEAD" and "Host:" lines?

    Try this instead:

    pc-bern-host ~ % (echo HEAD http://www.google.co.uk HTTP/1.1; echo Host: www.google.co.uk; echo) | nc www.bbc.co.uk 80
    HTTP/1.0 200 OK
    Date: Thu, 27 Aug 2009 17:56:51 GMT
    Expires: -1
    Cache-Control: private, max-age=0
    Content-Type: text/html; charset=ISO-8859-1
    Set-Cookie: PREF=ID=becdf844de4646ef:TM=1251395811:LM=1251395811:S=fw0Opyy0MpsCcWGz; expires=Sat, 27-Aug-2011 17:56:51 GMT; path=/; domain=.google.co.uk
    Server: gws
    X-Cache: MISS from localhost
    Proxy-Connection: close


  • OK…I got this:

    $ (echo HEAD http://www.google.co.uk HTTP/1.1; echo Host: www.google.co.uk; echo) | nc www.bbc.co.uk 80
    HTTP/1.1 200 OK
    Date: Thu, 27 Aug 2009 18:04:26 GMT
    Server: Apache
    Set-Cookie: BBC-UID=e4da39661c9a8aca15a1fbc961f338dbd123db1a4070d144448f2977cdc6a1bf0; expires=Mon, 26-Aug-13 18:04:26 GMT; path=/; domain=bbc.co.uk;
    Accept-Ranges: bytes
    Cache-Control: max-age=0
    Expires: Thu, 27 Aug 2009 18:04:26 GMT
    Pragma: no-cache
    Content-Length: 61338
    Content-Type: text/html; charset=iso-8859-1

    Connection closed by foreign host.


  • You're not being transparently proxied then.


  • @Bern:

    You're not being transparently proxied then.

    UGH! I'm confused by the concurrent use of Squid and HAVP. It appears HAVP is running (via whatismyip) but now Squid is not.