Jump to content

Help needed: Have workflows work with proxy servers


Recommended Posts

Posted (edited)

I need some help here. Its very frustrating that all the nifty workflows dont work when using proxies. I have narrowed down the problem to curl command used in workflows.php which I think is the one that issues requests to remote locations. I tested out the following command 

curl --proxy www.proxy.server:proxy_port_number -I https://twitter.com          which worked.

 

I am not really familiar with php or python or curl commands/options, so can anyone tell me what changes I should do to the workflows.php file for it to work?

Also how do I make sure curl does not use the proxy when I'm at home using regular internet.

 

Also as a feature request, can alfred discover and apply proxy settings automatically the way chrome/firefox do?

 

Edited by angie
Posted

I need some help here. Its very frustrating that all the nifty workflows dont work when using proxies. I have narrowed down the problem to curl command used in workflows.php which I think is the one that issues requests to remote locations. I tested out the following command 

curl --proxy www.proxy.server:proxy_port_number -I https://twitter.com          which worked.

 

I am not really familiar with php or python or curl commands/options, so can anyone tell me what changes I should do to the workflows.php file for it to work?

Also how do I make sure curl does not use the proxy when I'm at home using regular internet.

 

Also as a feature request, can alfred discover and apply proxy settings automatically the way chrome/firefox do?

 

Workflows.php would needed to be edited on/around line 336 to add a new default option when making a curl request. As far as making it not use the proxy when you are at home.. I'm not sure what the best path for that would be. I actually find it odd that curl requests from the script don't go through the proxy considering its a system wide setting (assuming that your using a proxy connection that is set up in Network preferences)?

Posted (edited)

Thanks for the reply!

Network preferences are set to auto proxy discovery and automatic proxy configuration. I have the .pac file from which i got the proxy server.

 

Currently on VPN to the office network... i tried the curl command in the terminal window

curl -I http://google.com gives no output in the window

 

curl with proxy gives this

 

HTTP/1.1 301 Moved Permanently
Content-Type: text/html; charset=UTF-8
Date: Mon, 29 Apr 2013 08:06:40 GMT
Expires: Wed, 29 May 2013 08:06:40 GMT
Cache-Control: public, max-age=2592000
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Content-Length: 219
Proxy-Connection: Keep-Alive
Connection: Keep-Alive
 
So I guess its a problem with the curl not getting the proxy settings by default. Do I add the CURLOPT_PROXY option to the curl options? Any other option to go with it?
Edited by angie
Posted

Thanks for the reply!

Network preferences are set to auto proxy discovery and automatic proxy configuration. I have the .pac file from which i got the proxy server.

 

Currently on VPN to the office network... i tried the curl command in the terminal window

curl -I http://google.com gives no output in the window

 

curl with proxy gives this

 

HTTP/1.1 301 Moved Permanently
Content-Type: text/html; charset=UTF-8
Date: Mon, 29 Apr 2013 08:06:40 GMT
Expires: Wed, 29 May 2013 08:06:40 GMT
Cache-Control: public, max-age=2592000
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Content-Length: 219
Proxy-Connection: Keep-Alive
Connection: Keep-Alive
 
So I guess its a problem with the curl not getting the proxy settings by default. Do I add the CURLOPT_PROXY option to the curl options? Any other option to go with it?

 

I've not messed with pushing curl requests through a proxy yet. Try checking the documentation for curl and see what switches are available for setting proxy settings for curl. You may be able to set something in .netrc to cover this as well.

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...