Using Axe DevTools Linter with a Proxy

This page is not available in the language you requested. You have been redirected to the English version of the page.
Link to this page copied to clipboard

How to configure Axe DevTools Linter to work with HTTP proxies

Free Trial
Not for use with personal data

Axe DevTools Linter supports proxy configuration through environment variables, enabling you to route linting requests through your organization's proxy infrastructure.

Requirements

To use proxy support with Axe DevTools Linter, you need:

  • Proxy software running locally or on your organization's servers
  • The endpoint for your proxy
  • The proxy's certificate authority (CA) certificate (to authorize it on your machine)
important

When using the Deque-hosted SaaS servers, HTTPS is the only supported protocol. If you're self-hosting an on-premises instance, you can use HTTP and will need your proxy's HTTP endpoint. The HTTP endpoint is typically on the same host as the HTTPS endpoint, but on port 80 rather than 443; verify this with your network administrator.

Environment Variables

Proxy configuration for Axe DevTools Linter is handled entirely through environment variables, which fall into two categories.

Standard Proxy Environment Variables

Variable Description
HTTPS_PROXY The endpoint used for HTTPS protocol requests
HTTP_PROXY The endpoint used for HTTP protocol requests
NO_PROXY A comma-separated list of hostnames that should bypass the proxy

Axe DevTools Linter and Node.js Environment Variables

Variable Description
AXE_LINTER_USE_ENV_PROXY Enables proxy support specifically for Axe DevTools Linter
AXE_USE_ENV_PROXY Enables proxy support for all Deque tools that support this variable
NODE_USE_ENV_PROXY Node.js native proxy support (version 24 or later only)
NODE_EXTRA_CA_CERTS Path to trusted CA certificates for HTTPS connections
note

The NODE_USE_ENV_PROXY variable was introduced in Node.js version 24 to enable proxy support globally for a process. Axe DevTools Linter has back-ported support for this variable to work across all Node.js versions.

Enabling Proxy Support

To enable proxy support, set any of the AXE_* variables to 1. To disable proxy support for Axe DevTools Linter while keeping it enabled for Node.js, set either AXE_LINTER_USE_ENV_PROXY or AXE_USE_ENV_PROXY to 0.

important

Only the values 1 (enabled) and 0 (disabled) are recognized. Any other value will disable proxy support.

For HTTPS connections, you must specify the path to your proxy's certificate authority (CA) certificate using NODE_EXTRA_CA_CERTS. Without this, connections will be rejected as untrusted.

Configuration Examples

You can set environment variables in two ways: globally for a machine or CI job, or inline for a single command.

GitHub Actions Workflow

The following example shows how to configure proxy environment variables in a GitHub Actions workflow:

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run Axe DevTools Linter
        env:
          HTTPS_PROXY: https://localhost:9090
          NODE_EXTRA_CA_CERTS: /path/to/ca.pem
          AXE_LINTER_USE_ENV_PROXY: 1
        run: npm run lint

Local Command Line

To set proxy variables for a single command on Linux or macOS:

AXE_LINTER_USE_ENV_PROXY=1 HTTPS_PROXY=https://localhost:9090 NODE_EXTRA_CA_CERTS=/path/to/ca.pem npm run lint

Using Axe DevTools Linter Connector with a Proxy

When using the Axe DevTools Linter Connector, configure the proxy variables before running the connector:

export HTTPS_PROXY=https://proxy.example.com:9090
export NODE_EXTRA_CA_CERTS=/path/to/ca.pem
export AXE_LINTER_USE_ENV_PROXY=1

axe-linter-connector -s . -d . --api-key YOUR_API_KEY --url https://axe-linter.deque.com/

Bypassing the Proxy for Specific Hosts

Use the NO_PROXY environment variable to specify destination hosts or domains that should not be proxied. This is useful when certain domains need direct access.

NO_PROXY=internal.example.com,localhost axe-linter-connector -s . -d .

Node.js 24 and Later

In Node.js version 24 and later, NODE_USE_ENV_PROXY is enabled by default for all requests. If you need to bypass the proxy for Axe DevTools Linter while keeping it enabled for other requests, use the NO_PROXY variable:

NODE_USE_ENV_PROXY=1 HTTPS_PROXY=https://our.intranet/proxy NO_PROXY=axe.deque.com,axe-linter.deque.com npm run lint
tip

Even if you set AXE_LINTER_USE_ENV_PROXY=0, Node.js version 24 or later will still route requests through the proxy because of the global request dispatcher. Use NO_PROXY to bypass the proxy for specific domains.

Troubleshooting

Certificate Errors

If you receive certificate-related errors, ensure that:

  1. The NODE_EXTRA_CA_CERTS path points to a valid certificate file
  2. The certificate is in PEM format
  3. The certificate matches your proxy's CA

Connection Refused

If connections are refused:

  1. Verify the proxy endpoint is correct and accessible.
  2. Check that the proxy is running and accepting connections.
  3. Confirm you're using the correct protocol (HTTP vs HTTPS).

Proxy Not Being Used

If requests aren't routing through the proxy:

  1. Verify that if AXE_LINTER_USE_ENV_PROXY is set, it's not set to a value other than 1.
  2. Check that HTTPS_PROXY (or HTTP_PROXY for on-premises) is set correctly.
  3. Ensure the target host or domain isn't listed in NO_PROXY.

See Also