forked from cloudfoundry/docs-cf-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhttp-proxy.html.md.erb
106 lines (61 loc) · 3.09 KB
/
http-proxy.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
title: Using the cf CLI with a Proxy Server
owner: CLI
---
This topic describes using the Cloud Foundry Command Line Interfact (cf CLI) with a proxy server.
<a id='overview'></a> Overview
If you have an HTTP or SOCKS5 proxy server on your network between a host running the cf CLI and your 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, as in the example below:
```
https_proxy=http://proxy.example.com
```
If the proxy server requires a username and password, you must include the credentials, as in the example below:
```
https_proxy=http://username:[email protected]
```
If the proxy server uses a port other than 80, you must include the port number, as in the example below:
```
https_proxy=http://username:[email protected]:8080
```
If the proxy server is a SOCKS5 proxy, you must specify the SOCKS5 protocol in the URL, as in the example below:
```
https_proxy=socks5://socks_proxy.example.com
```
## <a id="v3-ssh-socks5"></a> Use SOCKS5 with v3-ssh
The `cf v3-ssh` command supports SOCKS5 proxies.
To specify the SOCKS5 proxy server:
1. Set the `ALL_PROXY` environment variable, as in the example below:
```
ALL_PROXY=socks5://socks_proxy.example.com
```
<p class="note"><strong>Note:</strong> The <code>cf ssh</code> command does not work through a SOCKS5 proxy.</p>
## <a id="mac-linux"></a> Set https_proxy in Mac OS or Linux
To set the `https_proxy` environment variable in Mac OS or Linux:
1. Use the command specific to your shell. For example, in bash, use the `export` command, as in the example below:
```
export https_proxy=http://my.proxyserver.com:8080
```
1. To make this change persistent, add the command to the appropriate profile file for the shell. For example, in bash, add a line like example below to your `.bash_profile` or `.bashrc` file:
```
https_proxy=http://username:password@hostname:port
export $https_proxy
```
## <a id="windows"></a> Set https_proxy in Windows
To set the `https_proxy` environment variable in Windows:
1. Open the **Start** menu.
1. 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:
1. Select **Advanced**.
1. Click **Environment Variables**.
<%= image_tag("./images/env-var.png") %>
1. Under **User variables**, click **New**.
<%= image_tag("./images/new.png") %>
1. For **Variable name**, enter `https_proxy`.
1. For **Variable value**, enter your proxy server information.
<%= image_tag("./images/proxy.png") %>
1. Click **OK**.