How to Configure a Proxy in VSCode, Git, and npm for Developers

How to Configure a Proxy in VSCode, Git, and npm for Developers

Developers working behind corporate firewalls, in restricted network environments, or through proxy-based workflows need to configure proxy settings across their entire toolchain. Unlike browsers that follow system proxy settings, developer tools like VSCode, Git, npm, pip, and others each require their own proxy configuration.

This guide provides step-by-step instructions for configuring proxies in all the major developer tools, with practical examples for HTTP, HTTPS, and SOCKS5 proxies.

Visual Studio Code (VSCode)

Method 1: VSCode Settings (GUI)

  1. Open VSCode.
  2. Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS) to open the Command Palette.
  3. Type “settings” and select Preferences: Open Settings (UI).
  4. Search for “proxy”.
  5. Configure:
  • Http: Proxy: http://username:password@proxy.example.com:8080
  • Http: Proxy Strict SSL: Toggle off if you are behind an SSL-intercepting proxy
  • Http: Proxy Authorization: Set if your proxy uses custom authorization headers
  • Http: Proxy Support: Select override (uses VSCode proxy), on (uses environment variables), fallback, or off

Method 2: VSCode Settings (JSON)

  1. Press Ctrl+Shift+P and select Preferences: Open User Settings (JSON).
  2. Add:
{
    "http.proxy": "http://username:password@proxy.example.com:8080",
    "http.proxyStrictSSL": false,
    "http.proxySupport": "override"
}

Method 3: Workspace-Specific Proxy

For project-specific proxy settings, create or edit .vscode/settings.json in your workspace:

{
    "http.proxy": "http://proxy.example.com:8080",
    "http.proxyStrictSSL": true
}

What VSCode Proxy Affects

The VSCode proxy setting controls:

  • Extension installation and updates from the marketplace
  • Remote development connections
  • Built-in HTTP requests (REST Client extension, etc.)
  • Git operations within VSCode (if using VSCode’s integrated Git)
  • Language server downloads

Note: The VSCode proxy does not affect the integrated terminal. Terminal commands use their own proxy settings (environment variables).

VSCode Extensions Behind a Proxy

If extensions fail to install:

  1. Verify the proxy setting is correct.
  2. Set "http.proxyStrictSSL": false if your proxy uses a self-signed certificate.
  3. Add the marketplace URL to your proxy’s allowlist: marketplace.visualstudio.com.

Git

Git has its own proxy settings, separate from the system and VSCode.

Configure HTTP/HTTPS Proxy

# Global proxy (all repositories)
git config --global http.proxy http://username:password@proxy.example.com:8080
git config --global https.proxy http://username:password@proxy.example.com:8080

# Repository-specific proxy
git config http.proxy http://proxy.example.com:8080

Configure SOCKS5 Proxy

git config --global http.proxy socks5://proxy.example.com:1080
git config --global https.proxy socks5://proxy.example.com:1080

# With DNS resolution through proxy
git config --global http.proxy socks5h://proxy.example.com:1080

Proxy for Specific Domains

Configure a proxy only for specific Git hosts:

# Proxy only for GitHub
git config --global http.https://github.com.proxy http://proxy.example.com:8080

# Proxy only for GitLab
git config --global http.https://gitlab.com.proxy http://proxy.example.com:8080

# Direct connection for internal Git server
git config --global http.https://git.internal.com.proxy ""

SSH Proxy for Git

If you use Git over SSH and need to proxy SSH connections:

Edit ~/.ssh/config:

Host github.com
    HostName github.com
    User git
    ProxyCommand nc -X 5 -x proxy.example.com:1080 %h %p

On Windows with PuTTY, use connect.exe or ncat as the proxy command.

Remove Git Proxy

git config --global --unset http.proxy
git config --global --unset https.proxy

Verify Git Proxy Settings

git config --global --get http.proxy
git config --global --get https.proxy

SSL Certificate Issues with Git Proxy

If your proxy intercepts SSL:

# Disable SSL verification (development only)
git config --global http.sslVerify false

# Better: Add your proxy's CA certificate
git config --global http.sslCAInfo /path/to/ca-certificate.pem

npm (Node Package Manager)

Configure npm Proxy

# HTTP proxy
npm config set proxy http://username:password@proxy.example.com:8080

# HTTPS proxy
npm config set https-proxy http://username:password@proxy.example.com:8080

Remove npm Proxy

npm config delete proxy
npm config delete https-proxy

Verify npm Proxy Settings

npm config get proxy
npm config get https-proxy

# Or view all config
npm config list

npm SSL Certificate Issues

Behind an SSL-intercepting proxy:

# Disable strict SSL (development only)
npm config set strict-ssl false

# Better: Specify CA certificate
npm config set cafile /path/to/ca-certificate.pem

npm .npmrc File

All npm config settings are stored in ~/.npmrc:

proxy=http://username:password@proxy.example.com:8080
https-proxy=http://username:password@proxy.example.com:8080
strict-ssl=false

Project-level .npmrc (in the project root) overrides global settings.

yarn

# Yarn 1
yarn config set proxy http://proxy.example.com:8080
yarn config set https-proxy http://proxy.example.com:8080

# Yarn Berry (v2+)
yarn config set httpProxy http://proxy.example.com:8080
yarn config set httpsProxy http://proxy.example.com:8080

pnpm

pnpm config set proxy http://proxy.example.com:8080
pnpm config set https-proxy http://proxy.example.com:8080

pip (Python)

Temporary Proxy

pip install package-name --proxy http://username:password@proxy.example.com:8080

Permanent Configuration

Create or edit ~/.config/pip/pip.conf (Linux/macOS) or %APPDATA%\pip\pip.ini (Windows):

[global]
proxy = http://username:password@proxy.example.com:8080
trusted-host = pypi.org
               pypi.python.org
               files.pythonhosted.org

Using Environment Variables

export PIP_PROXY="http://proxy.example.com:8080"

pip with SOCKS5

pip install pysocks
pip install package-name --proxy socks5://proxy.example.com:1080

Composer (PHP)

# Environment variables
export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=http://proxy.example.com:8080

# Or in composer command
HTTP_PROXY=http://proxy.example.com:8080 composer install

Maven (Java)

Edit ~/.m2/settings.xml:

<settings>
    <proxies>
        <proxy>
            <id>corporate-proxy</id>
            <active>true</active>
            <protocol>http</protocol>
            <host>proxy.example.com</host>
            <port>8080</port>
            <username>username</username>
            <password>password</password>
            <nonProxyHosts>localhost|127.0.0.1|*.internal.com</nonProxyHosts>
        </proxy>
    </proxies>
</settings>

Gradle (Java/Kotlin)

Edit ~/.gradle/gradle.properties:

systemProp.http.proxyHost=proxy.example.com
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=username
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=localhost|127.0.0.1|*.internal.com

systemProp.https.proxyHost=proxy.example.com
systemProp.https.proxyPort=8080
systemProp.https.proxyUser=username
systemProp.https.proxyPassword=password

Go

# Environment variables
export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=http://proxy.example.com:8080
export NO_PROXY=localhost,127.0.0.1,.internal.com

# These affect go get, go mod download, etc.
go env -w GOPROXY="https://proxy.golang.org,direct"

Docker

For Docker proxy configuration, see our dedicated guide on using proxies with Docker containers.

curl and wget

curl

# HTTP proxy
curl -x http://proxy.example.com:8080 https://api.ipify.org

# SOCKS5 proxy
curl --socks5-hostname proxy.example.com:1080 https://api.ipify.org

# Permanent via ~/.curlrc
echo 'proxy = http://proxy.example.com:8080' >> ~/.curlrc

wget

# Temporary
wget -e http_proxy=http://proxy.example.com:8080 https://example.com/file.zip

# Permanent via ~/.wgetrc
echo 'http_proxy = http://proxy.example.com:8080' >> ~/.wgetrc
echo 'https_proxy = http://proxy.example.com:8080' >> ~/.wgetrc
echo 'use_proxy = on' >> ~/.wgetrc

Universal Environment Variables

Setting these environment variables covers most developer tools:

# Add to ~/.bashrc, ~/.zshrc, or ~/.profile
export http_proxy="http://username:password@proxy.example.com:8080"
export https_proxy="http://username:password@proxy.example.com:8080"
export HTTP_PROXY="$http_proxy"
export HTTPS_PROXY="$https_proxy"
export no_proxy="localhost,127.0.0.1,.local,.internal.com"
export NO_PROXY="$no_proxy"

Many tools check both lowercase and uppercase versions, so set both for maximum compatibility.

Handling Self-Signed Proxy Certificates

Corporate proxies often use SSL interception with self-signed certificates. Here is how to handle this across tools:

# Git
git config --global http.sslCAInfo /path/to/corporate-ca.pem

# npm
npm config set cafile /path/to/corporate-ca.pem

# pip
pip config set global.cert /path/to/corporate-ca.pem

# Node.js
export NODE_EXTRA_CA_CERTS=/path/to/corporate-ca.pem

# curl
curl --cacert /path/to/corporate-ca.pem https://example.com

# Python requests
export REQUESTS_CA_BUNDLE=/path/to/corporate-ca.pem

Practical Scenarios

Working Behind a Corporate Firewall

Corporate networks frequently require proxies. A typical developer setup:

  1. Set environment variables in your shell profile.
  2. Configure Git, npm, and pip individually.
  3. Set VSCode proxy settings.
  4. Add the corporate CA certificate to each tool.

Using Proxies for Web Scraping Development

When developing web scraping tools, route your test requests through a mobile proxy to simulate real user behavior:

  1. Configure your HTTP client library with proxy settings.
  2. Use environment variables for easy proxy switching between development and production.
  3. Test with different proxy regions.

Troubleshooting Developer Tool Proxy Issues

“UNABLE_TO_GET_ISSUER_CERT_LOCALLY”

Your proxy is performing SSL interception. Add its CA certificate to the affected tool or temporarily disable SSL verification.

“407 Proxy Authentication Required”

  1. Verify your proxy credentials.
  2. Ensure special characters in passwords are URL-encoded.
  3. Check if the proxy uses NTLM authentication (not supported by all tools).

“ECONNREFUSED” or “Connection Refused”

  1. Verify the proxy address and port.
  2. Test connectivity: curl -x http://proxy:8080 https://example.com
  3. Check firewall rules.

Tool Ignoring Proxy Settings

  1. Some tools only check environment variables, not config files (and vice versa).
  2. Ensure both lowercase and uppercase environment variables are set.
  3. Restart your terminal after changing environment variables.

For more about proxy protocols and concepts, see our proxy glossary.

Conclusion

Developer tools each have their own proxy configuration mechanism, which means setting up a proxy-based development environment requires configuring multiple tools individually. Start with universal environment variables to cover the majority of tools, then configure Git, npm, pip, and VSCode specifically. For corporate environments with SSL-intercepting proxies, distributing the CA certificate to each tool is the most important step. Keep a reference of your proxy settings accessible so you can quickly configure new tools and environments.


Related Reading

last updated: April 3, 2026

Scroll to Top

Resources

Proxy Signals Podcast
Operator-level insights on mobile proxies and access infrastructure.

Multi-Account Proxies: Setup, Types, Tools & Mistakes (2026)