Automatic proxy with libwww

Fernando Levin (Fernando.Levin@italtel.it)
Wed, 05 Aug 1998 10:30:51 +0200


Hi,
I'm new to libwww programming so sorry if my question may seem obvious
to you, but I have the following problem.
I am using a HP J210XC Workstation with HP-UX 10.20 operating system
(Unix) running Netscape 3.0.
I can access the outside world through a proxy, which needs the option
"automatic proxy configuration" set to a file "conf.pac".
It then asks me for a username and password (first time only) and then I
can go outside. The "pac" file looks something like this:

function FindProxyForURL(url, host)
{

 if (localHostOrDomainIs(host, "www.xxxx.it") )
          return "PROXY proxy.xxxx.it:8081;" ;
 else if (  localHostOrDomainIs(host, "ftp.xxxx.it") )
                return "PROXY proxy.xxxx.it:8081;" ;
 else if ( localHostOrDomainIs(host, "usix.xxxx.it") )
                return "PROXY proxy.xxxx.it:8082;"  ;
 else if ( localHostOrDomainIs(host, "www.yyyy.it") )
                return "PROXY proxy.xxxx.it:8081;"  ;
 else if (isPlainHostName(host))
             return "DIRECT";
 else if (dnsDomainLevels(host) == 1)
         if (isInNet(host, "101.102.0.0", "255.255.0.0"))
            return "DIRECT";
 ........................(A LOT MORE !!! )....................
 else
           return "PROXY proxy.xxxx.it:8080;" ;
}

How can I configure libwww to use such a weird configuration ???

-- 
Fernando Levin