Search squid archive

Re: Domains without "www." - Probably silly question ....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>> On 11/01/2007 at 16:07, Jakob Curdes <jc@xxxxxxxxxxxxxxx> wrote:

>>I am told that one way to restore the automated logics done by the
>>browser in finding the correct host name even when using a proxy is
to
>>use a proxy.pac file which depends on the IP of the destination
site.
>>You could try this, haven't verified myself.
>>
>>Not 100% sure how to do it but I suppose it's possible to detect the
>>lookup failure somehow and then return DIRECT from the pac..
>>  
>>
> I could not find anything specific to this. Would it not be possible
to 
> use a small URL rewriter that rewrites one-dot URL to its "www." form
?
> Sure this is a bad hack as it would not solve xyz.bogus.com or cope
with 
> differente content in xyz.com and www.xyz.com but as far as I
understand 
> Netscape's old doc on PAC syntax you can select different proxies or
go 
> direct based on the URL but there is no way to tell the Browser to 
> rewrite the URL itself - and going direct ist not an option; the
whole 
> point of the proxy business was to shut down direct internet access
for 
> the clients....

I think the trick here is to *tell* the browser to go direct - as long
as
it is allowed to perform DNS lookups, it will then get the DNS error
it
normally gets, and will try again for www.xyz.com instead - which goes
through the proxy as intended. The client never actually fetches
directly -
all it needs to do is make the attempt and fail, triggering the
'correction'
to www.* instead. All it needs for this is a working DNS server.

Simply putting this snippet in a PAC file should do:

function FindProxyForURL(url,host)
{
   if (isResolvable(host))
      return "PROXY myproxy:3128";
   else
      return "DIRECT";
}

should do the job you need: inaccessible addresses are tried directly
(and
fail, as they would anyway), everything else goes through the proxy.


James.

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux