cli icon indicating copy to clipboard operation
cli copied to clipboard

Allow http_proxy in addition to HTTP_PROXY variable

Open gberche-orange opened this issue 12 years ago • 7 comments

Currently the cli seems to only honor the HTTP_PROXYenv var (upper case) and ignores http_proxy.

The http_proxy lower case is pretty common as the following extract from the curl command shows.

As a result, it is sometimes time consumming to newcomers to debug why the http_proxy env var is silently ignored

curl(1)                                             Curl Manual                                             curl(1)

NAME
       curl - transfer a URL
[...]
ENVIRONMENT
       The  environment  variables  can be specified in lower case or upper case. The lower case version has prece-
       dence. http_proxy is an exception as it is only available in lower case.

       Using an environment variable to set the proxy has the same effect as using the --proxy option.

       http_proxy [protocol://]<host>[:port]
              Sets the proxy server to use for HTTP.

       HTTPS_PROXY [protocol://]<host>[:port]
              Sets the proxy server to use for HTTPS.
[...]     
$ http_proxy=http://127.0.0.1:3128 HTTP_PROXY= cf-v6.3.0.exe curl info
RATÉ
demande Erreur de création:
GetAddrInfoW: No such host is known.

$ http_proxy=http://127.0.0.1:3128 HTTP_PROXY=http://127.0.0.1:3128 cf-v6.3.0.exe curl info
{
   "name": "vcap",
[...]
   }
}

$ http_proxy= HTTP_PROXY=http://127.0.0.1:3128 cf-v6.3.0.exe curl info
{
   "name": "vcap",
[...]
   }
}

gberche-orange avatar Jul 17 '14 10:07 gberche-orange

We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/75182382.

cf-gitbot avatar Jul 17 '14 10:07 cf-gitbot

Sure, we'll make this enhancement.

lcddave avatar Jul 17 '14 14:07 lcddave

Thanks Dave!

gberche-orange avatar Jul 17 '14 16:07 gberche-orange

@gberche-orange Can you provide more detail about the failure case? We can't reproduce it. The CLI passes along the responsibility for proxying to golang's http.ProxyFromEnvironment function, which should respond to both lower and upper case proxy environment variable. It does this properly for us.
Thanks!

goehmen avatar Aug 08 '14 18:08 goehmen

Hi @gberche-orange Sorry to be a pest, but the CLI team's story is getting closer to the top of the backlog. It is currently blocked until we can get input from you on creating a reproducible test case. We get proper responses to both http_proxy and HTTP_PROXY. Thanks

goehmen avatar Aug 13 '14 17:08 goehmen

OK. I'll go ahead and close this issue. If you're able to provide more details to help us reproduce, please reopen the issue.

goehmen avatar Aug 25 '14 16:08 goehmen

Hi @goehmen. Sorry for late response, I was away for a few weeks and just got back. I just retried and am unable to reproduce as well regardless of the version (from 6.1 to 6.4). I must have made a mis-diagnostic when submitting the issue, not sure how.

Apologies for that and the associated wasted time on this.

gberche-orange avatar Aug 25 '14 17:08 gberche-orange