cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Little problem on the libcurl.dll generation

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 23 Aug 2001 15:49:35 +0200 (MET DST)

On Thu, 23 Aug 2001, Steve Lhomme wrote:

> After a few search, I've found that you have to use wininet.dll to
> retrieve this kind of information (see InternetGetConnectedState and
> InternetQueryOption / INTERNET_OPTION_PROXY ). But if you use it, that
> makes libcurl useless (on windows machines), because it can do whatever
> libcurl does (I think). :(

Possibly, yes.

> The only advantage would be to have a portable code to other platforms
> (only the connection detection would be platform dependant).

There could be other differences too. Like different APIs and different
levels of support for the exact stuff you want to do. But of course, I guess
libcurl looks pityful in comparison to what a giant commercial company
produces.

> The problem I have is when you have auto proxy configuration (through PAC
> files) (see http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-
> live.html ) you have to parse that configuration file (that also works on
> Linux or any platform where Mozilla/Netscape works) which is a bit
> complicated for what I wanted to do (on Mozilla, they use a JavaScript
> code to parse it). :(
>
> If anyone have such a parser in C or C++ it'd be glad to try it :)

This question was ventilated before just a few weeks ago. AFAIK, there's no
easily available parser for javascript (my suggestion, if anyone would ever
like to walk that narrow path, is still to extract the one Mozilla is using).

Mostly, those javascript snippets are very small and you can usually either
read it and just use the proxy that's mentioned in there, or you can write a
little (perl) script that extracts the proxy name/address.

Organisations tend to not change proxies very often, so having those config
files as javascript code is almost always just a way to make complex
selections which proxy to use for different remote (or local) servers.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-08-23