Jump to content

Set `http_proxy` environmental variable for workflows

Recommended Posts

As things stand, workflows that require web access are basically just going to break on a machine that can only access the web via a proxy server.

Alfred should set the http_proxy environmental variable before calling any workflow.

Currently, it is not only necessary for every workflow to be "proxy aware" if it wants to work on all machines, but it is also extremely difficult to determine the proxy server from a script, as it depends on the current network profile and Apple's command line utilities don't provide a straightforward way to get the proxy address.

By setting the http_proxy environmental variable before running a workflow's script, Alfred could make using the proxy entirely transparent to Ruby/Python workflow authors (both languages' standard network libraries will automatically use the proxy specified in http_proxy, as will curl), and much easier to use for workflows written in other languages (they can grab the environmental variable rather than trying to coax the same information out of OS X themselves).

Essentially, workflow authors shouldn't need to have to worry about network settings, as far as that can be avoided, not least of all because it represents something that currently needs to be implemented separately in every single workflow that needs web access.

Edited by deanishe
Link to comment
Share on other sites

  • 3 weeks later...

A discussion of this topic.
TL;DR: workflows do not—and never will—work with proxy servers without support from Alfred. This would be relatively trivial for Alfred to implement, but extremely difficult—maybe impossible—for a workflow to do (unless it's written in Objective-C). And it would need to be done in every single workflow.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...