Re: WPAC configuration in Tiger (and beyond)
Re: WPAC configuration in Tiger (and beyond)
- Subject: Re: WPAC configuration in Tiger (and beyond)
- From: David Young <email@hidden>
- Date: Fri, 5 Aug 2005 09:01:48 -0700
If what you're looking for is a mechanism to get the results from a
PAC file and use it in your application which does not use CF/NS, no
such official mechanism exists (that I know of), but rdar://3914712/
tracks the problem.
If you are writing a Cocoa app you can use a hidden WebView's
stringByEvaluatingJavaScriptInString: to execute a PAC file. If your
PAC files use any of the PAC DNS functions (getMyIpAddress or
whatever), this will normally fail as these methods aren't exported
by KJS. What you can do to get around this is to preprocess the PAC
file, replacing calls to these functions with your own JavaScript
functions which call prompt() to communicate with the Objective-C
side, then do the DNS stuff there and return the result. This method
is necessary if you want to support OS versions < 10.3.9. For >
10.3.9, you can probably use the new WebKit-JavaScript communications
methods.
In a previous life I worked on a project where they embedded the
mozilla JS engine *just* to process PAC files. Needless to say, this
is killing a mosquito with a sledgehammer, but it's something to
consider if your memory footprint is not a concern.
Hope this helps,
--dave
On Aug 5, 2005, at 8:48 AM, Jeremy Wyld wrote:
The proxy dictionary does nothing more than hold the settings as
produced by the user and saved by the Network Preferences pane.
After verifying that the checkbox for PAC is turned on, you should
see a couple entries in the dictionary, "ProxyAutoConfigEnable" and
"ProxyAutoConfigURLString." "ProxyAutoConfigEnable" should have a
value of 1. This will indicate that the PAC should be used. It's
up to you to determine how all these should be used. Now if these
settings are not being flushed out to SystemConfiguration, make
sure you file a bug.
Now, if you use CFNetwork for performing a HTTP or FTP request, it
will interpret the dictionary and will make automatic use of the
settings. To see how and in what order it chooses to interpret
that dictionary, I suggest reading the code directly at http://
darwinsource.opendarwin.org/10.4.2/CFNetwork-128.2/Proxies/
ProxySupport.c and you can see how everything comes into play.
If you are not using CFNetwork or are below HTTP/FTP, you'll need
to do the work yourself. I would then suggest filing an
enhancement to have CFNetwork export a function which does the
heavy lifting. I don't see any particular reason why such a
function or such support couldn't be exported.
jeremy
On Aug 5, 2005, at 8:26 AM, Nathan Herring wrote:
[Originally sent to CarbonIT before I realized this list existed.]
Our IT department has a PAC file for use with our Windows browsers.
However, if in 10.4.2, I try and set my proxies "Using a PAC file",
nothing works outside of the firewall.
The CFDictionary information we use to connect shows a bunch of the
proxy server information correctly set in, but the XXXXEnable
setting is
false, and we use that to determine whether or not to use that proxy
server.
Q: Is it a known issue that the proxy settings don't quite configure
correctly?
Q: How do you differentiate between internal servers (i.e. proxy
exceptions) and others?
AFAICT, unless you meta-interpret the Java script to extract the
known
proxy exceptions, there's no good way to build the list -- you
just have
to ask the script how to connect to server X for each server X.
What is the future direction of development here? Should we (as
network
applications writers) be expected to use PAC files? Or will Apple
provide a functional intermediate layer above the PAC file? Or
will the
proxy settings dictionary eventually "just work"?
TIA,
nh
----
Nathan Herring
MacBU SDE/Development
<bowlderized_wpad.dat>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40geeks.org
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden