Jump to content
json

support .pac or port of a host

Recommended Posts

it seems workflow support neither pac file nor https , even not allow me to set a port of a host file.

i hope i can use the auto proxy by a pac file which is configged by system network setting.

Share this post


Link to post
Share on other sites

Alfred passes your system proxy settings to workflows via the standard http_proxy and https_proxy environmental variables if you have properly configured Web Proxy and Secure Web Proxy in your Network settings. UNIX-y tools like curl, Python etc. will use the proxy automatically.
 
Unfortunately, Alfred can't realistically handle proxies configured via a proxy.pac file for your workflow because of the way proxy.pac autoconfiguration works.
 
A proxy.pac file is a JavaScript program that defines a FindProxyForURL(url, host) function which the client calls before every request to get the appropriate proxy. Alfred can't do that for your workflow because it has no idea the workflow is opening a URL, let alone which one. It's basically up to you and whatever language you're writing your workflow in.
 
Alfred could provide the URL of the proxy.pac file, but it'd still be up to your workflow to provide a JavaScript environment (that implements all the proxy.pac functions) to execute it in.
 
The best solution I can think of would be a small, native command-line utility that you can pass a URL and it will return the appropriate proxy for you based on the system configuration. OS X's HTTP libraries take care of all the proxy settings for you, including proxy.pac, so it might be possible to initialise a connection with a URL and then extract the computed proxy address.
 
I will look into it later this afternoon. Hopefully, it's possible to get at the computed proxy without actually opening a connection.

Edited by deanishe

Share this post


Link to post
Share on other sites

I couldn't find a way to pull the actual computed proxy details out of Cocoa (as opposed to the auto-configuration URL). I'm pretty clueless with Objective-C and Cocoa, mind you.

Someone who knows it better might have more luck.

Share this post


Link to post
Share on other sites

Just had another idea. If you can get the proxy.pac URL from the system (which is simple enough), you could use pacparser to execute the proxy.pac file and determine the correct proxy settings.
 
But I imagine it would slow your workflow down quite a bit.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...