Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
79 lines (51 sloc) 2.55 KB
---
title: Using the cf CLI with a Proxy Server
owner: CLI
---
<strong><%= modified_date %></strong>
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.
The `https_proxy` environment variable holds the hostname or IP address of your
proxy server.
`https_proxy` is a standard environment variable.
Like any environment variable, the specific steps you use to set it depends on
your operating system.
## <a id="format"></a>Format of https_proxy ##
`https_proxy` is set with hostname or IP address of the proxy server in URL
format: `https_proxy=http://proxy.example.com`
If the proxy server requires a user name and password, include the credentials:
`https_proxy=http://username:password@proxy.example.com`
If the proxy server uses a port other than 80, include the port number:
`https_proxy=http://username:password@proxy.example.com:8080`
If the proxy server is a SOCKS5 proxy, specify the SOCKS5 protocol in the URL:
`https_proxy=socks5://socks_proxy.example.com`
<p class="note"><strong>Note</strong>: <code>cf ssh</code> does not work through a SOCKS5 proxy.</p>
## <a id="mac-linux"></a>Setting https_proxy in Mac OS or Linux ##
Set the `https_proxy` environment variable using the command specific to your
shell.
For example, in bash, use the `export` command.
Example:
<pre class=terminal>
$ export https_proxy=http:/<span>/</span>my.proxyserver.com:8080
</pre>
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 `.bash_profile` or
`.bashrc` file:
<pre class="detect-script"t>
https_proxy=http://username:password@hostname:port
export $https_proxy
</pre>
## <a id="windows"></a>Setting https_proxy in Windows ##
1. Open the Start menu. Right-click **Computer** and select **Properties**.
<%= image_tag("./images/properties.png") %>
1. In the left pane of the System window, click **Advanced system settings**.
<%= image_tag("./images/adv-settings.png") %>
1. In the System Properties window, select the **Advanced** tab, then click
**Environment Variables**.
<%= image_tag("./images/env-var.png") %>
1. In the Environment Variables window, under User variables, click **New**.
<%= image_tag("./images/new.png") %>
1. In the Variable name field, input `https_proxy`.
In the Variable value field, input your proxy server information.
<%= image_tag("./images/proxy.png") %>
1. Click **OK**.