Skip to content

[BUG] HTTP_PROXY / HTTPS_PROXY env vars not respected on Windows corporate networks #1782

Description

@chirag127

Describe the bug
On Windows machines behind a corporate HTTP proxy, the extension fails to establish database connections even when HTTP_PROXY and HTTPS_PROXY environment variables are correctly set system-wide.

Steps to reproduce

  1. Set HTTP_PROXY=http://proxy.corp.example.com:8080 and HTTPS_PROXY=http://proxy.corp.example.com:8080 as Windows system environment variables (or in the VS Code terminal session).
  2. Open VS Code on a machine where direct outbound TCP to port 3306 / 5432 / 6379 is blocked — all traffic must go through the corporate proxy.
  3. Create a new connection to a database accessible only via the proxy.
  4. Click "Test Connection" or attempt to connect.

Expected behavior
Extension picks up HTTP_PROXY / HTTPS_PROXY (and NO_PROXY) from the process environment, the same way Node.js https-proxy-agent / global-agent would, and routes connection attempts through the proxy.

Actual behavior
Connection attempt times out or is refused. The proxy env vars are silently ignored. Connections work only when the proxy is bypassed at the network level.

Environment

  • OS: Windows 11 Enterprise (22H2 / 23H2)
  • VS Code: 1.100+
  • Extension: vscode-database-client (latest)
  • Node.js proxy handling: HTTP_PROXY env var is set but extension's underlying TCP driver does not pick it up

Notes
Node.js does not automatically respect HTTP_PROXY for raw TCP net.connect() calls — it only applies to http.request. DB drivers (mysql2, pg, ioredis) open raw sockets and need explicit proxy agent injection. A fix would be to detect HTTP_PROXY/HTTPS_PROXY at connection creation time and route through a SOCKS/HTTP tunnel (e.g. https-proxy-agent or socks-proxy-agent).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions