Re: Howto extract proxy from .pac script?



On Jun 18, 4:01 am, Heath Raftery <hraft...@xxxxxxxxxxxxx> wrote:
Andrei Korostelev <and...@xxxxxxxxxxxxxx> wrote:
I have a path to the .pac file received using SystemConfiguration
Framework API. This .pac file allows selecting the appropriate proxy
server for a given URL.

The question is: is it any C/C++ API to extract proxy from this .pac
file for a given URL?

You need a full blown JavaScript interpreter - .pac files can use any
valid JavaScript, even though they often just do "if url is local,
return no proxy, else return this proxy". In my proxy server,
Authoxy, I used SpiderMonkey to do this. Fortunately, Authoxy is now
open source[1] (and I contributed some work back to the SpiderMonkey
team), so you'll welcome to benefit from what I've already done.

However, until Patrick posted in this thread, I was unaware of the
Cocoa interface. If I had the choice, I'd probably try to use that,
if I already had access to the Cocoa frameworks.

[1]http://sourceforge.net/projects/authoxy-panther/

--
*--------------------------------------------------------*
| ^Nothing is foolproof to a sufficiently talented fool^ |
| Heath Raftery, HRSoftWorks _\|/_ |
*______________________________________m_('.')_m_________*

Thanks to everybody. As I already noticed above, I solved the probvlem
by using JavaScript inpetrpreter from SpiderMonkey. Works fine both in
Mac and in Win. What I was looking for is a dedicated API in Mac OS X
to do the same. Carbon is the highest possible API layer I can use, so
Cocoa does not seem right choice. Nevertheless, thanks for you
autoproxy link, Heath.

.



Relevant Pages

  • Re: Urgent problem: Cannot connect to URL
    ... > webserver (without proxy). ... this wasn't possible from the client we found ... > on the second request the .pac file is downloaded from the proxy (as it ... > this was only the case when we were logged in as a normal user. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Getting IE automated proxy settings from Java or JScript?
    ... The site with the client machines is using automated proxy ... From either Java or Javascript/Jscript, find the URL to the PAC file ... Sun's documentation claims the Java Plug-in preloads when it starts. ... I cannot hard code the auto configuration URL, ...
    (microsoft.public.scripting.jscript)
  • Re: Urgent problem: Cannot connect to URL
    ... webserver (without proxy). ... this wasn't possible from the client we found ... on the second request the .pac file is downloaded from the proxy (as it ... Is that script affected by the Security settings ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • If a PAC file download problem occurs, how to go on ?
    ... I have an important question about using and modifying a PAC file (proxy ... We have two proxy servers, and normally both are up and running. ... If the server isn't anymore available, the clients will try to download the ... But the browser does not use the cached file, instead, an error message ...
    (microsoft.public.isaserver)
  • RE: Maybe OT - Anon. Proxy
    ... javascript and java disabled and accepting any cookie as session cookie ... and it recommended the possibility of an anonymous proxy. ... Can you really browse the www with javascript disabled these days? ... conditions IE allows activeX to break the script security model). ...
    (Ubuntu)