Optional Installation Step: Configuring Private Location's Agents To Use a Corporate Proxy

If you want to configure your Agents to connect to BlazeMeter via a Proxy Server on your internal corporate network, here's what you should do for each installation.

If your BlazeMeter Agent is configured to use HTTP_PROXY or HTTPS_PROXY properties, you must bypass localhost calls; the NO_PROXY settings for 127.0.0.1 and localhost (provided below) are required for Transaction-based virtual services to work. If you do not use any HTTP_PROXY or HTTPS_PROXY settings, you can skip the NO_PROXY setting.

Docker Installation

Follow these steps:

  1. Follow the same process for installing an agent, but stop once you have generated the docker run command. For more information about how to set up CA bundle with a proxy, see Configuring a Docker Installation to Use CA Bundle.

  2. Copy the docker run command and add the following environment variables (using the same format and data in the variables below, including the case-sensitivity) to the command, as one line:
    --env HTTP_PROXY=http://server:port 
    --env HTTPS_PROXY=http://server:port (or https://server:port)
    --env NO_PROXY=127.0.0.1,localhost,myHostname.com
    If you have authentication required for your proxy, then instead use the following options to pass the username and password, all on one line:
    --env HTTP_PROXY=http://username:password@server:port 
    --env HTTPS_PROXY=https://username:password@server:port
    --env NO_PROXY=127.0.0.1,localhost,myHostname.com
    The full command with the additions will look like below:

    docker run -d --env HTTP_PROXY=http://server:port --env HTTPS_PROXY=https://server:port --env NO_PROXY=127.0.0.1,localhost,myHostname.com --env HARBOR_ID=<Harbor ID> --env SHIP_ID=<Ship ID> --env AUTH_TOKEN=<Auth Token> --env AUTO_UPDATE=true --env DISTRIBUTION=stable --name=blazemeter-crane --restart=on-failure -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp --net=host blazemeter/crane python agent/agent.py

    If you have any special characters in your username and/or password, add single quotes (') around the environment variables that contain them (i.e. HTTP_PROXY and HTTPS_PROXY) as shown in the example below:
    --env 'HTTP_PROXY=http://username:password@server:port'
  3. Once you have made the edits above, copy the edited command, run it on the machine that you are installing the ship, and follow the final steps in the ship install to finish the installation.

See this note on how to approach running your scripts on a private location with this setting applied.

Kubernetes Installation

Follow these steps:

  1. Follow the same process for installing an agent, but stop once you get to the Kubernetes deployment command.
  2. In the Kubernetes command, add the following environment variables in the apps/v1 > spec > env section:
    { name: HTTP_PROXY, value: http://server:port }, 
    { name: HTTPS_PROXY, value: http://server:port (or https://server:port) },
    { name: NO_PROXY, value: kubernetes.default,127.0.0.1,localhost,myHostname.com }
    If you have authentication required for your proxy, then you will need to add the following to pass the username and password:
    { name: HTTP_PROXY, value: http://username:password@server:port }, 
    { name: HTTPS_PROXY, value: http://username:password@server:port (or https://username:password@server:port) },
    { name: NO_PROXY, value: kubernetes.default,127.0.0.1,localhost,*.myHostname.com }
    The environment configuration command with the additions will look like the following:

    apiVersion: apps/v1
    kind: Deployment
    metadata: { name: crane, labels: { role: role-crane, harbor_id: HARBOR_ID, ship_id: SHIP_ID } }
    spec: { selector: { matchLabels: { role: role-crane, harbor_id: HARBOR_ID, ship_id: SHIP_ID } }, replicas: 1, strategy: { type: Recreate }, template: { metadata: { labels: { role: role-crane, harbor_id: HARBOR_ID, ship_id: SHIP_ID } }, spec: { restartPolicy: Always, terminationGracePeriodSeconds: 30, containers: [{ name: bzm-crane-5fb2f5a65c99071c0f79bfd6, image: 'blazemeter/crane:latest', imagePullPolicy: Always, env: [{ name: HARBOR_ID, value: HARBOR_VALUE }, { name: SHIP_ID, value: SHIP_VALUE }, { name: AUTH_TOKEN, value: TOKEN_VALUE }, { name: CONTAINER_MANAGER_TYPE, value: KUBERNETES }, { name: IMAGE_OVERRIDES, value: '{}' }, { name: DOCKER_REGISTRY, value: gcr.io/verdant-bulwark-278 }, { name: AUTO_KUBERNETES_UPDATE, value: 'true' }, { name: HTTP_PROXY, value: http://server:port }, { name: HTTPS_PROXY, value: http://server:port (or https://server:port) }, { name: NO_PROXY, value: 127.0.0.1,localhost,*.myHostname.com }] }] } } }

  3. Once you have made the edits above, you can return to the Kubernetes installation steps to finish your installation.

See this note on how to approach running your scripts on a private location with this setting applied.

Regarding Running Scripts

If you would like to run tests on external sites that are not contained within your proxy, you will need to set the proxy server and port (and if you use authentication, your username, and password) in your JMeter test, as shown below.

configuring private location agents using corporate proxy