Skip to content

Proxy Configuration

If your network requires an HTTP proxy (common in corporate environments with SSL inspection), you can configure tdx to route all API requests through a proxy.

Setting a Proxy

There are three ways to configure a proxy, listed in priority order:

1. Global config — Add proxy to ~/.config/tdx/tdx.json:

{
  "proxy": "http://proxy.corp.com:8080"
}

2. Environment variable — Set HTTPS_PROXY or HTTP_PROXY:

export HTTPS_PROXY=http://proxy.corp.com:8080

3. SDK — Pass proxy option when creating a TDX instance programmatically:

const tdx = TDX.create({
  site: 'us01',
  proxy: 'http://proxy.corp.com:8080'
});

Proxy with Authentication

If your proxy requires authentication, include credentials in the URL:

{
  "proxy": "http://username:password@proxy.corp.com:8080"
}

Credentials are automatically masked in logs and error messages.

Resolution Order

When tdx needs a proxy, it checks these sources in order:

  1. SDK proxy option (programmatic use only)
  2. Global configproxy field in ~/.config/tdx/tdx.json
  3. HTTPS_PROXY environment variable
  4. HTTP_PROXY environment variable

Verifying Proxy Configuration

Use --debug to confirm proxy is being used:

tdx --debug databases
# Look for "Using HTTP proxy: http://proxy.corp.com:8080" in output

Troubleshooting

ErrorCauseFix
PROXY_CONNECTION_FAILURECannot reach the proxy serverVerify proxy URL and that the proxy is running
407 Proxy Authentication RequiredProxy credentials are wrong or missingAdd or fix username:password@ in the proxy URL
ECONNREFUSEDTarget server unreachable (not a proxy issue)Check your network or TD API endpoint