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) http://www.0008888.com/jixie004/001.htm http://www.0008888.com/jixie004/002.htm http://www.0008888.com/jixie004/003.htm http://www.0008888.com/jixie004/004.htm http://www.0008888.com/jixie004/005.htm http://www.0008888.com/jixie004/006.htm http://www.0008888.com/jixie004/007.htm http://www.0008888.com/jixie004/008.htm http://www.0008888.com/jixie004/009.htm http://www.0008888.com/jixie004/010.htm http://www.0008888.com/jixie004/011.htm http://www.0008888.com/jixie004/012.htm http://www.0008888.com/jixie004/013.htm http://www.0008888.com/jixie004/014.htm http://www.0008888.com/jixie004/015.htm http://www.0008888.com/jixie004/016.htm http://www.0008888.com/jixie004/017.htm http://www.0008888.com/jixie004/018.htm http://www.0008888.com/jixie004/019.htm http://www.0008888.com/jixie004/020.htm http://www.0008888.com/jixie004/021.htm http://www.0008888.com/jixie004/022.htm http://www.0008888.com/jixie004/023.htm http://www.0008888.com/jixie004/024.htm http://www.0008888.com/jixie004/025.htm http://www.0008888.com/jixie004/026.htm http://www.0008888.com/jixie004/027.htm http://www.0008888.com/jixie004/028.htm http://www.0008888.com/jixie004/029.htm http://www.0008888.com/jixie004/030.htm http://www.0008888.com/jixie004/031.htm http://www.0008888.com/jixie004/032.htm http://www.0008888.com/jixie004/033.htm http://www.0008888.com/jixie004/034.htm http://www.0008888.com/jixie004/035.htm http://www.0008888.com/jixie004/036.htm http://www.0008888.com/jixie004/037.htm http://www.0008888.com/jixie004/038.htm http://www.0008888.com/jixie004/039.htm http://www.0008888.com/jixie004/040.htm http://www.0008888.com/jixie004/041.htm http://www.0008888.com/jixie004/042.htm http://www.0008888.com/jixie004/043.htm http://www.0008888.com/jixie004/044.htm http://www.0008888.com/jixie004/045.htm http://www.0008888.com/jixie004/046.htm http://www.0008888.com/jixie004/047.htm http://www.0008888.com/jixie004/048.htm http://www.0008888.com/jixie004/049.htm http://www.0008888.com/jixie004/050.htm http://www.0008888.com/jixie004/051.htm http://www.0008888.com/jixie004/052.htm http://www.0008888.com/jixie004/053.htm http://www.0008888.com/jixie004/054.htm http://www.0008888.com/jixie004/055.htm http://www.0008888.com/jixie004/056.htm http://www.0008888.com/jixie004/057.htm http://www.0008888.com/jixie004/058.htm http://www.0008888.com/jixie004/059.htm http://www.0008888.com/jixie004/060.htm http://www.0008888.com/jixie004/061.htm http://www.0008888.com/jixie004/062.htm http://www.0008888.com/jixie004/063.htm http://www.0008888.com/jixie004/064.htm http://www.0008888.com/jixie004/065.htm http://www.0008888.com/jixie004/066.htm http://www.0008888.com/jixie004/067.htm http://www.0008888.com/jixie004/068.htm http://www.0008888.com/jixie004/069.htm http://www.0008888.com/jixie004/070.htm http://www.0008888.com/jixie004/071.htm http://www.0008888.com/jixie004/072.htm http://www.0008888.com/jixie004/073.htm http://www.0008888.com/jixie004/074.htm http://www.0008888.com/jixie004/075.htm http://www.0008888.com/jixie004/076.htm http://www.0008888.com/jixie004/077.htm http://www.0008888.com/jixie004/078.htm http://www.0008888.com/jixie004/079.htm http://www.0008888.com/jixie004/080.htm http://www.0008888.com/jixie004/081.htm http://www.0008888.com/jixie004/082.htm http://www.0008888.com/jixie004/083.htm http://www.0008888.com/jixie004/084.htm http://www.0008888.com/jixie004/085.htm http://www.0008888.com/jixie004/086.htm http://www.0008888.com/jixie004/087.htm http://www.0008888.com/jixie004/088.htm http://www.0008888.com/jixie004/089.htm http://www.0008888.com/jixie004/090.htm http://www.0008888.com/jixie004/091.htm http://www.0008888.com/jixie004/092.htm http://www.0008888.com/jixie004/093.htm http://www.0008888.com/jixie004/094.htm http://www.0008888.com/jixie004/095.htm http://www.0008888.com/jixie004/096.htm http://www.0008888.com/jixie004/097.htm http://www.0008888.com/jixie004/098.htm http://www.0008888.com/jixie004/099.htm http://www.0008888.com/jixie004/100.htm http://www.0008888.com/jixie004/101.htm http://www.0008888.com/jixie004/102.htm http://www.0008888.com/jixie004/103.htm http://www.0008888.com/jixie004/104.htm http://www.0008888.com/jixie004/105.htm http://www.0008888.com/jixie004/106.htm http://www.0008888.com/jixie004/107.htm http://www.0008888.com/jixie004/108.htm http://www.0008888.com/jixie004/109.htm http://www.0008888.com/jixie004/110.htm http://www.0008888.com/jixie004/111.htm http://www.0008888.com/jixie004/112.htm http://www.0008888.com/jixie004/113.htm http://www.0008888.com/jixie004/114.htm http://www.0008888.com/jixie004/115.htm http://www.0008888.com/jixie004/116.htm http://www.0008888.com/jixie004/117.htm http://www.0008888.com/jixie004/118.htm http://www.0008888.com/jixie004/119.htm http://www.0008888.com/jixie004/120.htm http://www.0008888.com/jixie004/121.htm http://www.0008888.com/jixie004/122.htm http://www.0008888.com/jixie004/123.htm http://www.0008888.com/jixie004/124.htm http://www.0008888.com/jixie004/125.htm http://www.0008888.com/jixie004/126.htm http://www.0008888.com/jixie004/127.htm http://www.0008888.com/jixie004/128.htm http://www.0008888.com/jixie004/129.htm http://www.0008888.com/jixie004/130.htm http://www.0008888.com/jixie004/131.htm http://www.0008888.com/jixie004/132.htm http://www.0008888.com/jixie004/133.htm http://www.0008888.com/jixie004/134.htm http://www.0008888.com/jixie004/135.htm http://www.0008888.com/jixie004/136.htm http://www.0008888.com/jixie004/137.htm http://www.0008888.com/jixie004/138.htm http://www.0008888.com/jixie004/139.htm http://www.0008888.com/jixie004/140.htm http://www.0008888.com/jixie004/141.htm http://www.0008888.com/jixie004/142.htm http://www.0008888.com/jixie004/143.htm http://www.0008888.com/jixie004/144.htm http://www.0008888.com/jixie004/145.htm http://www.0008888.com/jixie004/146.htm http://www.0008888.com/jixie004/147.htm http://www.0008888.com/jixie004/148.htm http://www.0008888.com/jixie004/149.htm http://www.0008888.com/jixie004/150.htm http://www.0008888.com/jixie004/151.htm http://www.0008888.com/jixie004/152.htm http://www.0008888.com/jixie004/153.htm http://www.0008888.com/jixie004/154.htm http://www.0008888.com/jixie004/155.htm http://www.0008888.com/jixie004/156.htm http://www.0008888.com/jixie004/157.htm http://www.0008888.com/jixie004/158.htm http://www.0008888.com/jixie004/159.htm http://www.0008888.com/jixie004/160.htm http://www.0008888.com/jixie004/161.htm http://www.0008888.com/jixie004/162.htm http://www.0008888.com/jixie004/163.htm http://www.0008888.com/jixie004/164.htm http://www.0008888.com/jixie004/165.htm http://www.0008888.com/jixie004/166.htm http://www.0008888.com/jixie004/167.htm http://www.0008888.com/jixie004/168.htm http://www.0008888.com/jixie004/169.htm http://www.0008888.com/jixie004/170.htm http://www.0008888.com/jixie004/171.htm http://www.0008888.com/jixie004/172.htm http://www.0008888.com/jixie004/173.htm http://www.0008888.com/jixie004/174.htm http://www.0008888.com/jixie004/175.htm http://www.0008888.com/jixie004/176.htm http://www.0008888.com/jixie004/177.htm http://www.0008888.com/jixie004/178.htm http://www.0008888.com/jixie004/179.htm http://www.0008888.com/jixie004/180.htm http://www.0008888.com/jixie004/181.htm http://www.0008888.com/jixie004/182.htm http://www.0008888.com/jixie004/183.htm http://www.0008888.com/jixie004/184.htm http://www.0008888.com/jixie004/185.htm http://www.0008888.com/jixie004/186.htm http://www.0008888.com/jixie004/187.htm http://www.0008888.com/jixie004/188.htm http://www.0008888.com/jixie004/189.htm http://www.0008888.com/jixie004/190.htm http://www.0008888.com/jixie004/191.htm http://www.0008888.com/jixie004/192.htm http://www.0008888.com/jixie004/193.htm http://www.0008888.com/jixie004/194.htm http://www.0008888.com/jixie004/195.htm http://www.0008888.com/jixie004/196.htm http://www.0008888.com/jixie004/197.htm http://www.0008888.com/jixie004/198.htm http://www.0008888.com/jixie004/199.htm http://www.0008888.com/jixie004/200.htm http://www.0008888.com/jixie004/201.htm http://www.0008888.com/jixie004/202.htm http://www.0008888.com/jixie004/203.htm http://www.0008888.com/jixie004/204.htm http://www.0008888.com/jixie004/205.htm http://www.0008888.com/jixie004/206.htm http://www.0008888.com/jixie004/207.htm http://www.0008888.com/jixie004/208.htm http://www.0008888.com/jixie004/209.htm http://www.0008888.com/jixie004/210.htm http://www.0008888.com/jixie004/211.htm http://www.0008888.com/jixie004/212.htm http://www.0008888.com/jixie004/213.htm http://www.0008888.com/jixie004/214.htm http://www.0008888.com/jixie004/215.htm http://www.0008888.com/jixie004/216.htm http://www.0008888.com/jixie004/217.htm http://www.0008888.com/jixie004/218.htm http://www.0008888.com/jixie004/219.htm http://www.0008888.com/jixie004/220.htm http://www.0008888.com/jixie004/221.htm http://www.0008888.com/jixie004/222.htm http://www.0008888.com/jixie004/223.htm http://www.0008888.com/jixie004/224.htm http://www.0008888.com/jixie004/225.htm http://www.0008888.com/jixie004/226.htm http://www.0008888.com/jixie004/227.htm http://www.0008888.com/jixie004/228.htm http://www.0008888.com/jixie004/229.htm http://www.0008888.com/jixie004/230.htm http://www.0008888.com/jixie004/231.htm http://www.0008888.com/jixie004/232.htm http://www.0008888.com/jixie004/233.htm http://www.0008888.com/jixie004/234.htm http://www.0008888.com/jixie004/235.htm http://www.0008888.com/jixie004/236.htm http://www.0008888.com/jixie004/237.htm http://www.0008888.com/jixie004/238.htm http://www.0008888.com/jixie004/239.htm http://www.0008888.com/jixie004/240.htm http://www.0008888.com/jixie004/241.htm http://www.0008888.com/jixie004/242.htm http://www.0008888.com/jixie004/243.htm http://www.0008888.com/jixie004/244.htm http://www.0008888.com/jixie004/245.htm http://www.0008888.com/jixie004/246.htm http://www.0008888.com/jixie004/247.htm http://www.0008888.com/jixie004/248.htm http://www.0008888.com/jixie004/249.htm http://www.0008888.com/jixie004/250.htm http://www.0008888.com/jixie004/251.htm http://www.0008888.com/jixie004/252.htm http://www.0008888.com/jixie004/253.htm http://www.0008888.com/jixie004/254.htm http://www.0008888.com/jixie004/255.htm http://www.0008888.com/jixie004/256.htm http://www.0008888.com/jixie004/257.htm http://www.0008888.com/jixie004/258.htm http://www.0008888.com/jixie004/259.htm http://www.0008888.com/jixie004/260.htm http://www.0008888.com/jixie004/261.htm http://www.0008888.com/jixie004/262.htm http://www.0008888.com/jixie004/263.htm http://www.0008888.com/jixie004/264.htm http://www.0008888.com/jixie004/265.htm http://www.0008888.com/jixie004/266.htm http://www.0008888.com/jixie004/267.htm http://www.0008888.com/jixie004/268.htm http://www.0008888.com/jixie004/269.htm http://www.0008888.com/jixie004/270.htm http://www.0008888.com/jixie004/271.htm http://www.0008888.com/jixie004/272.htm http://www.0008888.com/jixie004/273.htm http://www.0008888.com/jixie004/274.htm http://www.0008888.com/jixie004/275.htm http://www.0008888.com/jixie004/276.htm http://www.0008888.com/jixie004/277.htm http://www.0008888.com/jixie004/277.htm http://www.0008888.com/jixie004/278.htm http://www.0008888.com/jixie004/279.htm http://www.0008888.com/jixie004/280.htm http://www.0008888.com/jixie004/281.htm http://www.0008888.com/jixie004/282.htm http://www.0008888.com/jixie004/283.htm http://www.0008888.com/jixie004/284.htm http://www.0008888.com/jixie004/285.htm http://www.0008888.com/jixie004/286.htm http://www.0008888.com/jixie004/287.htm http://www.0008888.com/jixie004/288.htm http://www.0008888.com/jixie004/289.htm http://www.0008888.com/jixie004/290.htm http://www.0008888.com/jixie004/291.htm http://www.0008888.com/jixie004/292.htm http://www.0008888.com/jixie004/293.htm http://www.0008888.com/jixie004/294.htm http://www.0008888.com/jixie004/295.htm http://www.0008888.com/jixie004/296.htm http://www.0008888.com/jixie004/297.htm http://www.0008888.com/jixie004/298.htm http://www.0008888.com/jixie004/299.htm http://www.0008888.com/jixie004/300.htm http://www.0008888.com/jixie004/301.htm http://www.0008888.com/jixie004/302.htm http://www.0008888.com/jixie004/303.htm http://www.0008888.com/jixie004/304.htm http://www.0008888.com/jixie004/305.htm http://www.0008888.com/jixie004/306.htm http://www.0008888.com/jixie004/307.htm http://www.0008888.com/jixie004/308.htm http://www.0008888.com/jixie004/309.htm http://www.0008888.com/jixie004/310.htm http://www.0008888.com/jixie004/311.htm http://www.0008888.com/jixie004/312.htm http://www.0008888.com/jixie004/313.htm http://www.0008888.com/jixie004/314.htm http://www.0008888.com/jixie004/315.htm http://www.0008888.com/jixie004/316.htm http://www.0008888.com/jixie004/317.htm