cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: WPAD proxy (was Re: Need Help Please)

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Tue, 30 Dec 2014 17:42:23 -0500

On Tue, Dec 30, 2014 at 5:30 PM, Dan Fandrich <dan_at_coneharvesters.com>
wrote:

> On Tue, Dec 30, 2014 at 02:58:52PM +0000, Jones, Rick wrote:
> > I have packaged cURL for my enterprise developers to use when needed but
> am
> > having some issues.
> >
> > The installation part is easy, but I need to modify my package due to a
> > configuration issue. Please let me explain.
> >
> > We are in a very locked down environment; users and devs do not have
> access
> > rights to their machines; so everything must be packaged for them and
> installed
> > via SCCM.
> >
> > The problem is our proxy, we are using WPAD to get to an external proxy
> which
> > lets people out. What settings do I need to modify in order to use
> cURL? I
> > have tried setting http_proxy and https_proxy but I’m still unable to
> connect.
>
> WPAD generally provides a small Javascript program that's executed by the
> browser to determine which sites to send to a proxy and which proxy to use.
> curl doesn't contain a Javascript interpreter, so it can't use such a proxy
> configuration directly. It's (theoretically) possible to integrate a
> standalone
> Javascript interpreter with libcurl to handle this kind of proxy
> configuration,
> but it wouldn't be trivial. See the mailing list archives for previous
> questions about this.
>
> Alternately, for certain simple cases you could manually interpret the
> proxy
> configuration, extract the correct proxy server for the site(s) you're
> interested in, and provide that proxy server in http_proxy.
>

That little bit of Javascript is probably a proxy-auto-config (.pac) file.
I put in a few minutes way back when to see if we could automate processing
those. See this post for details on handling .pac in a script:

     http://curl.haxx.se/mail/archive-2002-06/0104.html

As long as you know where to get the .pac file, you may be able to exec a
script from your program to process it and return something usable. Dunno
how you'd do that in Windows, though.

Ralph Mitchell

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-12-30