angie Posted April 25, 2013 Posted April 25, 2013 (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 April 25, 2013 by angie
jdfwarrior Posted April 28, 2013 Posted April 28, 2013 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)?
angie Posted April 29, 2013 Author Posted April 29, 2013 (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 Location: http://www.google.com/ 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 April 29, 2013 by angie
jdfwarrior Posted April 29, 2013 Posted April 29, 2013 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 Location: http://www.google.com/ 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.
angie Posted May 3, 2013 Author Posted May 3, 2013 Scouring the net this is the best I came up with http://curl.haxx.se/mail/archive-2002-06/0104.html http://curl.haxx.se/mail/archive-2007-12/0059.html And it all is beyond my current level of expertise with scripting (perl is all I know ). Will still give link 2 a shot and try it some python based workflow. If it doesnt work I will just cross my fingers and hope alfred will support it in next version
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now