HTTP Proxy

Florian Diesch diesch at spamfence.net
Fri Apr 18 22:17:53 UTC 2008


Derek Broughton <news at pointerstop.ca> wrote:

> I have a satellite modem, and it's not uncommon for me to have no connection
> to the Internet (eg, this won't be going out for some time, as we haven't
> had a network connection for a week).
>
> I want an HTTP proxy that is smart enough to return cached pages any time it
> can't find the Internet, but all the proxies I've tried either need to be
> manually switched to "offline", 

If it first tries to fetch the page from the net that means you have
to wait for the DNS timeout on every page when you don't have
net. IMHO that's close to unusable.

> As a last resort, I could run a cron job that would set the proxy offline if
> it couldn't get a DNS result, but that's work ...

Something like

 if ping -c1 $IP_ADRESS_OF_YOUR_NAMESERVER; then
   wwwoffle -online
   wwwoffle -fetch
 else
   wwwoffle -offline
 fi

would do the job. And wwwoffle will fetch any page you requested
offline as soon as you have net.



   Florian
-- 
<http://www.florian-diesch.de/>
-----------------------------------------------------------------------
**  Hi! I'm a signature virus! Copy me into your signature, please!  **
-----------------------------------------------------------------------




More information about the ubuntu-users mailing list