forked from cloudfoundry/docs-buildpacks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproxy-usage.html.md.erb
33 lines (25 loc) · 1.64 KB
/
proxy-usage.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
---
title: Using a Proxy
owner: Buildpacks
---
<strong><%= modified_date %></strong>
This topic describes how developers can use a proxy with the buildpacks for their application.
##<a id='proxy-usage'></a> Use a Proxy
Buildpacks can use proxies via the `http_proxy` and/or `https_proxy` environment variables. These should be set to the proxy hostname and/or port.
All of the buildpacks will automatically utilize these proxy environment variables correctly. If any of them contact the internet during staging, it will be through the proxy host.
The binary buildpack will not use a proxy because it does not use the internet at all during staging.
To set a proxy to be used by buildpacks during staging, perform one of the following procedures:
* Set the environment variables by adding the following section to the `env` block of the application manifest [file](../devguide/deploy-apps/manifest.html#env-block):
<pre><code>---
env:
http\_proxy: http<span>://</span>YOUR-HTTP-PROXY:PORT
https\_proxy: https<span>://</span>YOUR-HTTPS-PROXY:PORT
</code></pre>
* Set the environment variables with the Cloud Foundry Command Line Interface (cf CLI) using the `cf set-env` command:
<pre class="terminal">
$ cf set-env YOUR-APP http\_proxy "http<span>://</span>YOUR-HTTP-PROXY:PORT"
$ cf set-env YOUR-APP https\_proxy "https<span>://</span>YOUR-HTTPs-PROXY:PORT"
</pre>
<p class="note"><strong>Note</strong>: While many applications will use the <code>http_proxy</code> and <code>https_proxy</code>
environment variables at runtime, this depends on the application. The buildpack does not add any extra functionality to make proxies
work at runtime.</p>