Using Pivotal Platform Dev Behind a Proxy

Page last updated:

This topic describes how to use Pivotal Platform Dev with a proxy.

Overview

In a restricted network environment, configuring Pivotal Platform Dev to connect to an HTTP proxy permits app-to-Internet connectivity, access to custom buildpacks, and the use of Docker images from the public Internet.

Run Pivotal Platform Dev Behind an HTTP Proxy

To run Pivotal Platform Dev behind a proxy, you must set the standard proxy environment variables for your platform before you start Pivotal Platform Dev.

Note: Proxy Support is not currently supported on Linux. That means the environment variables HTTP_PROXY, HTTPS_PROXY, and NO_PROXY, are not fully supported. Proxy Support on Linux is only supported in Pivotal Platform Dev v0.30 and earlier.

To set the standard proxy environment variables for your platform:

  1. Run one of the following sets of commands:

    • For Mac OS X:

      HTTP_PROXY=http://PROXY-IP:PROXY-PORT \
      HTTPS_PROXY=http://PROXY-IP:PROXY-PORT \
      cf dev start
      

      Where:

      • PROXY-IP is the IP address of your proxy.
      • PROXY-PORT is the port of your proxy.
    • For Windows PowerShell:

      $env:HTTP_PROXY = "http://PROXY-IP:PROXY-PORT"
      $env:HTTPS_PROXY = "http://PROXY-IP:PROXY-PORT"
      cf dev start
      

      Where:

      • PROXY-IP is the IP address of your proxy.
      • PROXY-PORT is the port of your proxy.
  2. Run:

    cf dev start
    

Note: Do not use localhost for PROXY-IP or as the proxy server hostname, because localhost refers to the Pivotal Platform Dev VM itself. If Pivotal Platform Dev needs to use a locally-running HTTP proxy, the proxy must be listening on all network interfaces, and you must address it as host.cfdev.sh. For a system domain dev.cfdev.sh, address the proxy as host.cfdev.sh, and so on.

Use the cf CLI Behind an HTTP Proxy

You must configure the Cloud Foundry Command-Line Interface (cf CLI) to bypass your HTTP proxy for addresses that end in local.pcfdev.io, which is your system domain. To configure the cf CLI:

  1. Ensure you have the latest version of the cf CLI installed from the Releases page of the cf CLI repository on GitHub.

  2. Run one of the following sets of commands:

    • For Mac OS X:
      export NO_PROXY=.dev.cfdev.sh,dev.cfdev.sh,$NO_PROXY
      cf login -a https://api.dev.cfdev.sh --skip-ssl-validation
    
    • For Windows PowerShell:
      $env:NO_PROXY = ".dev.cfdev.sh,dev.cfdev.sh,OTHER-DOMAINS"
      cf login -a https://api.ldev.cfdev.sh --skip-ssl-validation
    

Allow App Traffic to Bypass the Proxy

You can configure your apps to connect to other addresses without using the proxy. For example, you can connect apps to user-provided services on a private network.

To configure your apps to connect to other addresses without a proxy:

  1. Navigate to your app directory.

  2. Set the NO_PROXY environment variable to a comma-separated list of hosts by running:

    cf set-env APP-NAME NO\_PROXY=192.0.2.54,198.51.100.34
    

    Where APP-NAME is the name of the app you want to configure to connect to other addresses without a proxy.