2

I am using curl to access some web services through a proxy (an instance of polipo running on port 8123, chained to an ssh SOCKS5 proxy). If I provide proxy information using the http_proxy environment variable, it works just fine for requests using hostnames:

$ http_proxy=http://localhost:8123 curl http://overcloud-public-vip:5000/v2.0
{"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", ...

The name overcloud-public-vip isn't resolvable locally, but it can be resolved by the remote proxy to 192.168.30.6. If I try using the ip address of the target host instead of the hostname, it fails:

$ http_proxy=http://localhost:8123 curl  http://192.168.30.6:5000/v2.0/

On the other hand, the same url works just fine if I use the -x command line option instead of an environment variable:

$ curl -x http://localhost:8123 http://192.168.30.6:5000/v2.0/
{"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", ...

Why is there different behavior when specifying the proxy using a command line option vs. specifying the proxy in the environment? Is that a bug, or am I missing something?

larsks
  • 4,493

0 Answers0