Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 60431 invoked from network); 23 Jan 2008 18:57:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Jan 2008 18:57:10 -0000 Received: (qmail 62879 invoked by uid 500); 23 Jan 2008 18:57:00 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 62750 invoked by uid 500); 23 Jan 2008 18:56:59 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 62592 invoked by uid 99); 23 Jan 2008 18:56:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jan 2008 10:56:58 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [217.22.192.104] (HELO www.elogos.de) (217.22.192.104) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jan 2008 18:56:46 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by www.elogos.de (Postfix) with ESMTP id C0D0647992 for ; Wed, 23 Jan 2008 18:50:18 +0000 (UTC) Subject: Re: mod_proxy chaining with a .pac file From: Ralf Mattes Reply-To: rm@seid-online.de To: modules-dev@httpd.apache.org In-Reply-To: <47978BEF.2030303@joe-lewis.com> References: <47960031.1090609@joe-lewis.com> <479633D3.7070409@joe-lewis.com> <4797506B.4060000@joe-lewis.com> <479783A8.7080404@joe-lewis.com> <1201112856.6570.2.camel@localhost.localdomain> <47978BEF.2030303@joe-lewis.com> Content-Type: text/plain Date: Wed, 23 Jan 2008 19:56:31 +0100 Message-Id: <1201114591.6570.6.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Wed, 2008-01-23 at 11:48 -0700, Joe Lewis wrote: > Ralf Mattes wrote: > > On Wed, 2008-01-23 at 11:12 -0700, Joe Lewis wrote: > > > >> Giovanni Donelli wrote: > >> > >>> I am trying to make Apache follow the same rules as the browser > >>> > >>> > >> Realize that the browser doesn't get the configurations for each website > >> it visits, it only configures, then runs using the same configuration > >> for every website. > >> > > > > Realize that, since a .pac file is a ECMA-Script program, that > > configuration can (and often will) be dynamic. The proxy needs to be > > determined for each request. > > > > > >> That means it should be easy to create a simple module that has a single > >> configuration directive that points to the next proxy in the chain, > >> something like > >> > >> WPADConfiguration http://secondproxyserver.example.com/my-proxy-file.pac > >> > >> And then just configure mod_proxy, mod_proxy_http, and create a handler > >> that prefaces all URL's with the proxy: string, set the proxyreq setting > >> in the request_rec to an appropriate value, and return 1 to allow > >> mod_proxy to handle the rest of it. > >> > > > > No - that's too simple. The module needs to run the JS function for each > > request and has to be able to dynamically set the proxy. > > > > Indeed - I had completely forgotten about that. Isn't there a > javascript library could be connected into, or should the module be > written in perl to use that? I suppose parsing the file manually would > work. But I don't like reinventing wheels. There _IS_ a library (C and python(?) interface) - downloadable from the google code link posted in the first message ... trivial to link into an Apache module. AFAIK it uses the mozilla JS code. Cheers, RalfD > Joe