Differences between revisions 4 and 7 (spanning 3 versions)
Revision 4 as of 2004-09-19 09:10:02
Size: 7878
Editor: anonymous
Comment:
Revision 7 as of 2004-12-08 11:21:27
Size: 7881
Editor: anonymous
Comment:
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
The WPAD-standard is described in internet-draft available at The WPAD-standard is described in an internet-draft available at

Proxy Autoconfigure Setup

There are several ways to configure servers for clients to autodetect a proxy. I have seen RFC's that describe these but didn't keep links. Someone please add;

The WPAD-standard is described in an internet-draft available at http://www.web-cache.com/Writings/Internet-Drafts/draft-ietf-wrec-wpad-01.txt

References http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html

Autoconfigure URL Most modern web clients support proxy configuration using an autoconfigure URL. This is a url that points to a simple javascript that identifies the proxy to use for each request. These can be quite simple, or amazingly elaborate (search for Squid documentation on how to do load balencing or URL hashing of multiple proxies using autoconfigure URL's). The client needs to have the URL manually entered in its configuration. Other autoconfigure techniques are just extensions of this for automaticly identifying the autoconfigure URL to use.

Create a simple text file containing the autoconfigure script in the root of your webserver. This can have whatever name you want, but an unofficial convention seems to be proxy.pac. The autoconfigure url then becomes http://your.web.server/proxy.pac. An example proxy.pac is::

    function ["FindProxyForURL"](url,host)
    {
        if ( isPlainHostName(host) |||| localHostOrDomainIs(host, "your.local.domain") )
            return "DIRECT";
        return "PROXY your.proxy.server:8080; DIRECT";
    }

This tells the web browser to go direct for plain host names or for hosts in your.local.domain, otherwise use your.proxy.server, falling back to direct if it is down.

The URL should be served up with a particular mime type, but I'm not sure what the RFC specifies, or how many clients actualy care about this. The default Debian mime type of .pac files is application/x-ns-proxy-autoconfig, and this is what apache serves it up as.

DNS based autodetection I forget the exact details, but one method of automaticlly identifying the autoconfigure URL is to use a special DNS name and URL for your domain. Some RFC or other specifies a URL in the form http://wpad.your.local.domain/wpad.dat. Note the file name is different to the defacto standard of proxy.pac. The simple solution for this is to make wpad.your.local.domain a CNAME to your webserver and put a symlink wpad.dat pointing at proxy.pac in your website root.

Note that Debian does not have the appropriate mime type for the proxy.dat file, so apache will serve this up as text/plain. This is signifiquant to some browsers, but not to some others. You need to configure Apache to force the correct mime type without deciding that all .dat files are for proxy configuration. The trick is to set up a virtual host in apache like wpad.your.local.domain, and to add the mime type within the virtual host directive.

DHCP based autodetection I'm not sure if it's the same RFC, but the autoconfigure URL can also be delivered to clients by DHCP. I think IE is currently the only client that supports this. To do this, put the following in your /etc/dhcpd.conf ::

    # This is the wpad proxy autoconfig setting
    option option-252 "http://your.web.server/proxy.pac";

I can't help but feel that DHCP is so tied to OS level network initialisation that clients that just run on top of an OS will never use this. Only clients that are tightly integrated with the OS like IE/win32 will be able to take advantage of it.

                  ----------------------

O proxy Autoconfigure setup lá é diversas maneiras configurarar usuários para clientes ao autodetect um proxy. Eu vi os RFC que descrevem estes mas não mantive as ligações. Alguém satisfaz adiciona; As referências 1. de cliente moderno da correia fotorreceptora do URL de http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html Autoconfigure a maioria suportam a configuração do proxy usando um URL do autoconfigure. Este é um URL esses pontos a um Javascript simples que identifique o proxy para se usar para cada pedido. Estes podem ser completamente simples, ou surpreendente elaborados (busca para a documentação do calamar em como a carregue balencing ou hashing do URL de proxies múltiplos usando URL do autoconfigure). O cliente necessita ter o URL incorporado manualmente a sua configuração. Outras técnicas do autoconfigure são extensões justas desta para automaticly identificar o URL do autoconfigure para usar-se. Críe uma lima simples do texto que contem o certificado do autoconfigure na raiz de seu webserver. Isto pode ter o que nome você quer, mas uma convenção unofficial parece ser ' proxy.pac '. O URL do autoconfigure transforma-se então ' http://your.web.server/proxy.pac '. Um exemplo ' proxy.pac ' é::: função ["FindProxyForURL"](url, host) { se (isPlainHostName(host)||||o localHostOrDomainIs(host, "your.local.domain")) retornam" DIRIGEM "; retorne o "PROXY your.proxy.server:8080; DIRIJA "; } isto diz o web browser para ir direto para nomes de anfitrião lisos ou para anfitriões ' em your.local.domain ', se não em uso ' your.proxy.server ', caindo para trás para dirigir se estiver para baixo. O URL deve ser servido acima com um tipo particular do MIME, mas eu não sou certo o que o RFC especifica, ou quantos clientes se importam actualy com este. O tipo do MIME de Debian do defeito de limas do pac é ' application/x-ns-proxy-autoconfig ', e este é o que apache lhe serve acima como. Autodetection baseado DNS eu esqueço-me dos detalhes exatos, mas um método automaticlly de identificar o URL do autoconfigure deve usar um nome do DNS e um URL especiais para seu domínio. Algum RFC ou outro especificam um URL no formulário ' http://wpad.your.local.domain/wpad.dat '. Anote o nome da lima é diferente ao padrão do defacto ' de proxy.pac '. A solução simples para esta deve fazer ' a wpad.your.local.domain ' um CNAME a seu webserver e pôr um symlink ' wpad.dat ' que aponta ' em proxy.pac ' em sua raiz do website. Anote que Debian não tem o tipo apropriado do MIME para a lima de proxy.dat, assim que apache servirá a este acima como ' text/plain '. Isto é signifiquant a alguns browsers, mas não a algum outro. Você necessita configurarar Apache para forçar o tipo correto do MIME sem decidir-se que todas as limas do dat são para a configuração do proxy. O truque deve ajustar acima um anfitrião virtual em apache como wpad.your.local.domain, e adicionar o tipo do MIME dentro da diretriz orientadora virtual do anfitrião. DHCP baseou o autodetection que eu não sou certo se for o mesmo RFC, mas o URL do autoconfigure pode também ser entregado aos clientes por DHCP. Eu penso que o IE é atualmente o único cliente que suporta este. Para fazer isto, ponha o seguinte no seu '/etc/dhcpd.conf '::: # isto é o autoconfig do proxy do wpad que ajusta a opção option-252 "http://your.web.server/proxy.pac"; Eu não posso ajudar mas sentir que DHCP é assim que amarrado à iniciação da rede do nível do OS que os clientes que funcionam apenas no alto de um OS nunca usarão este. Somente clientes que são integrados firmemente com o OS como IE/win32 poderá fazer exame da vantagem dele. < b>DonovanBaarda, 2003/04/16 de UTC de 11:03 (através de web):</b><br > I pensou que eu escrevi algo neste em algum lugar... Agora o google deve poder encontrá-lo demasiado com meu nome nele mim Da3m0n

<b>2003/05/14 19:19 UTC (via web):</b>


Thanks for the translation work, but did you have to trash the original english version? I don't have a copy of it.. can we revive the original version?

2004/03/05 14:43 CET (via web): Original English translation restored from archive.org (http://web.archive.org/web/20030413062001/http://wiki.debian.net/ProxyAutodetectConf)