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)
- Open VSCode.
- Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS) to open the Command Palette.
- Type “settings” and select Preferences: Open Settings (UI).
- Search for “proxy”.
- 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, oroff
Method 2: VSCode Settings (JSON)
- Press Ctrl+Shift+P and select Preferences: Open User Settings (JSON).
- 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:
- Verify the proxy setting is correct.
- Set
"http.proxyStrictSSL": falseif your proxy uses a self-signed certificate. - 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:8080Configure 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:1080Proxy 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 %pOn 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.proxyVerify Git Proxy Settings
git config --global --get http.proxy
git config --global --get https.proxySSL 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.pemnpm (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:8080Remove npm Proxy
npm config delete proxy
npm config delete https-proxyVerify npm Proxy Settings
npm config get proxy
npm config get https-proxy
# Or view all config
npm config listnpm 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.pemnpm .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=falseProject-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:8080pnpm
pnpm config set proxy http://proxy.example.com:8080
pnpm config set https-proxy http://proxy.example.com:8080pip (Python)
Temporary Proxy
pip install package-name --proxy http://username:password@proxy.example.com:8080Permanent 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.orgUsing 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:1080Composer (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 installMaven (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=passwordGo
# 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' >> ~/.curlrcwget
# 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' >> ~/.wgetrcUniversal 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.pemPractical Scenarios
Working Behind a Corporate Firewall
Corporate networks frequently require proxies. A typical developer setup:
- Set environment variables in your shell profile.
- Configure Git, npm, and pip individually.
- Set VSCode proxy settings.
- 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:
- Configure your HTTP client library with proxy settings.
- Use environment variables for easy proxy switching between development and production.
- 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”
- Verify your proxy credentials.
- Ensure special characters in passwords are URL-encoded.
- Check if the proxy uses NTLM authentication (not supported by all tools).
“ECONNREFUSED” or “Connection Refused”
- Verify the proxy address and port.
- Test connectivity:
curl -x http://proxy:8080 https://example.com - Check firewall rules.
Tool Ignoring Proxy Settings
- Some tools only check environment variables, not config files (and vice versa).
- Ensure both lowercase and uppercase environment variables are set.
- 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.
- How to Configure a Proxy in FoxyProxy for Firefox
- How to Configure a Proxy on iPhone and iPad (iOS 18)
- Backconnect Proxies Deep Dive: Architecture and Real-World Performance
- Best Proxies in Southeast Asia: Singapore, Thailand, Indonesia, Philippines
- How to Build a 4G/5G Mobile Proxy Farm with Raspberry Pi
- Common cURL and Python Requests Proxy Errors (With Code Fixes)
- How to Configure a Proxy in FoxyProxy for Firefox
- How to Configure a Proxy on iPhone and iPad (iOS 18)
- Anti-Bot Detection Glossary: 50+ Terms Defined
- Anti-Bot Terminology Glossary: Complete A-Z Reference 2026
- Backconnect Proxies Deep Dive: Architecture and Real-World Performance
- Best Proxies in Southeast Asia: Singapore, Thailand, Indonesia, Philippines
- How to Configure a Proxy in FoxyProxy for Firefox
- How to Configure a Proxy on iPhone and iPad (iOS 18)
- Anti-Bot Detection Glossary: 50+ Terms Defined
- Anti-Bot Terminology Glossary: Complete A-Z Reference 2026
- Backconnect Proxies Deep Dive: Architecture and Real-World Performance
- Best Proxies in Southeast Asia: Singapore, Thailand, Indonesia, Philippines
- How to Configure a Proxy in FoxyProxy for Firefox
- How to Configure a Proxy on iPhone and iPad (iOS 18)
- 403 Forbidden Error: What It Means & How to Fix It
- 407 Proxy Authentication Required: Fix Guide
- Anti-Bot Detection Glossary: 50+ Terms Defined
- Anti-Bot Terminology Glossary: Complete A-Z Reference 2026
Related Reading
- How to Configure a Proxy in FoxyProxy for Firefox
- How to Configure a Proxy on iPhone and iPad (iOS 18)
- 403 Forbidden Error: What It Means & How to Fix It
- 407 Proxy Authentication Required: Fix Guide
- Anti-Bot Detection Glossary: 50+ Terms Defined
- Anti-Bot Terminology Glossary: Complete A-Z Reference 2026
last updated: April 3, 2026