Using the cf CLI with a Proxy Server
Page last updated:
If you have an HTTP or SOCKS5 proxy server on your network between a host running the cf CLI and your Cloud Foundry API endpoint, you must set
https_proxy with the hostname or IP address of the proxy server.
https_proxy environment variable holds the hostname or IP address of your
https_proxy is a standard environment variable.
Like any environment variable, the specific steps you use to set it depends on
your operating system.
https_proxy is set with hostname or IP address of the proxy server in URL
If the proxy server requires a user name and password, include the credentials:
If the proxy server uses a port other than 80, include the port number:
If the proxy server is a SOCKS5 proxy, specify the SOCKS5 protocol in the URL:
cf ssh does not work through a SOCKS5 proxy.
https_proxy environment variable using the command specific to your
For example, in bash, use the
$ export https_proxy=http://my.proxyserver.com:8080
To make this change persistent, add the command to the appropriate profile file
for the shell.
For example, in bash, add a line like the following to your
https_proxy=http://username:password@hostname:port export $https_proxy
Open the Start menu. Right-click Computer and select Properties.
In the left pane of the System window, click Advanced system settings.
In the System Properties window, select the Advanced tab, then click Environment Variables.
In the Environment Variables window, under User variables, click New.
In the Variable name field, input
https_proxy. In the Variable value field, input your proxy server information.