forked from cloudfoundry/docs-buildpacks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproxy-usage.html.md.erb
31 lines (22 loc) · 1.49 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
---
title: Using a Proxy
owner: Buildpacks
---
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 using the `http_proxy` and `https_proxy` environment variables. You should set these to the proxy hostname or port.
All of the buildpacks automatically use these proxy environment variables correctly. If any buildpacks contacts the Internet during staging, it does so through the proxy host.
The binary buildpack does not use a proxy because it does not use the Internet during staging.
To set a proxy for buildpacks to use 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:
<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 apps use the <code>http_proxy</code> and <code>https_proxy</code> environment variables at runtime, some do not. The buildpack does not add extra functionality to make proxies work at runtime.</p>