Re: proxy.pac / autoconfig

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Thu, 31 May 2001 19:15:09 +0200

Collides with server acceleration.

The exact same thing can be done without any patching by either of the
following two approaches

a) server acceleration, "accelerating" some other HTTP server from where
the PAC file is served

b) Using a redirector helper

The preferred method is (a) as it allows you to use any method of
generating the PAC file. For example by using a CGI program you can
easily generate different PAC files for different browsers or networks.

--
Henrik Nordstrom
Squid Hacker
Henry Adam Bauer wrote:
> 
> I'm not a list member, so please cc me personally on any replies.
> 
> While evaluating SQUID to replace another proxy software package, we found
> that it didn't have the ability to serve up a proxy.pac easily (like our
> existing proxy software could).  I was therefore tasked to find a way to
> make it do so.  Here is a very simple 1-2-3 step process to do so; I hope
> someone else finds it useful.  This is against SQUID 2.3 STABLE4, but
> should apply generally.
> 
> If there's something horriby wrong with this method of serving up a
> proxy.pac, I'd love to hear it.  Also, if there's a
> newer/better/faster/cooler method of doing this, I'd love to hear of it.
> 
> This patch has worked well for several months on several SQUID boxes
> serving 61 gig (15 million requests) a day for >50k people. Unfortunately,
> I can't say where, because security gets pissy about people knowing what
> we run. :(
> 
> Anyways, the fix is below.  Responses or flames welcome.
> 
> Henry
> 
> 1. Add a proxy.pac file to ${SQUIDDIR}/etc/icons, fix permissions to match
> other icon files
> 
> 2. Add a line to ${SQUIDDIR}/etc/mime.conf, using tabs for separators:
> 
> \.pac$  application/x-ns-proxy-autoconfig       proxy.pac       -       ascii
> 
> 3. Patch the source:
> 
> *** client_side.c.orig  Thu Apr 12 09:45:30 2001
> --- client_side.c       Fri Jan 19 10:30:58 2001
> ***************
> *** 2208,2213 ****
> --- 2208,2217 ----
>       if ((t = strchr(url, '#')))       /* remove HTML anchors */
>         *t = '\0';
> 
> + /* check if we received "GET / HTTP/1.0", and if so, return proxy.pac */
> +         if ((strlen(url)==1) && (url[0]=='/')) {
> +            url="/squid-internal-static/icons/proxy.pac\0";
> +          }
>       /* handle internal objects */
>       if (internalCheck(url)) {
> 
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail - only $35
> a year!  http://personal.mail.yahoo.com/
Received on Thu May 31 2001 - 11:16:03 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:02 MST