SOCKS Proxy Not Supported Error — Fix (2026)
The Error
Error: SOCKS proxy not supported by default HTTP agent.
Set ALL_PROXY=socks5://localhost:1080 but Node.js does not support SOCKS natively.
Install a SOCKS-compatible agent: npm install socks-proxy-agent
This error occurs when you configure a SOCKS proxy (common with SSH tunnels and Tor) but Node.js’s default HTTP agent does not support the SOCKS protocol.
The Fix
- Install the SOCKS proxy agent globally:
npm install -g socks-proxy-agent
- Switch to an HTTP proxy instead of SOCKS if possible:
# Instead of SOCKS5:
# export ALL_PROXY=socks5://localhost:1080
# Use HTTP CONNECT proxy:
export HTTPS_PROXY=http://localhost:8080
- If you must use SOCKS (SSH tunnel), create an HTTP proxy bridge:
# Start SSH tunnel with HTTP proxy using socat
ssh -D 1080 your-server.com &
# Use a local HTTP-to-SOCKS bridge
npx proxy-chain -p 8080 -s socks5://localhost:1080 &
export HTTPS_PROXY=http://localhost:8080
claude "test"
Why This Happens
Node.js’s built-in http and https modules only support HTTP CONNECT proxies natively. SOCKS4/SOCKS5 proxies use a different protocol that requires a third-party agent. Setting ALL_PROXY or SOCKS_PROXY to a socks5:// URL does not work without additional packages because Node does not parse or handle the SOCKS handshake.
If That Doesn’t Work
- Use an SSH port forward instead of SOCKS:
ssh -L 8443:api.anthropic.com:443 your-server.com &
# Then connect to localhost:8443 instead
- Use
proxychainsto transparently SOCKS-ify all connections:
# Install proxychains
brew install proxychains-ng
# Configure /usr/local/etc/proxychains.conf
proxychains4 claude "test"
- Check that your SOCKS proxy is actually running:
curl --socks5 localhost:1080 https://api.anthropic.com 2>&1 | head -5
Prevention
Add this to your CLAUDE.md:
# Proxy Configuration
- Use HTTP proxies (HTTPS_PROXY) not SOCKS for Claude Code.
- If SOCKS is required, use a local HTTP-to-SOCKS bridge.
- SSH tunnels: prefer -L (port forward) over -D (SOCKS) for single hosts.
Related Error Messages
This fix also applies if you see variations of this error:
- Connection or process errors with similar root causes in the same subsystem
- Timeout variants where the operation starts but does not complete
- Permission variants where access is denied to the same resource
- Configuration variants where the same setting is missing or malformed
If your specific error message differs slightly from the one shown above, the fix is likely the same. The key indicator is the operation that failed (shown in the stack trace) rather than the exact wording of the message.
Frequently Asked Questions
Does this error affect all operating systems?
This error can occur on macOS, Linux, and Windows (WSL). The exact error message may differ slightly between platforms, but the root cause and fix are the same. macOS users may see additional Gatekeeper or notarization prompts. Linux users should check that the relevant system packages are installed. Windows users should ensure they are running inside WSL2, not native Windows.
Will this error come back after updating Claude Code?
Updates can occasionally reintroduce this error if the update changes default configurations or dependency requirements. After updating Claude Code, verify your project still builds and runs correctly. If the error returns, reapply the fix and check the changelog for breaking changes.
Can this error cause data loss?
No, this error occurs before or during an operation and does not corrupt existing files. Claude Code’s edit operations are atomic — they either complete fully or not at all. However, if the error occurs during a multi-step operation, you may have partial changes that need to be reviewed with git diff before continuing.
How do I report this error to Anthropic if the fix does not work?
Open an issue at github.com/anthropics/claude-code with: (1) the full error message including stack trace, (2) your Node.js version (node --version), (3) your Claude Code version (claude --version), (4) your operating system and version, and (5) the command or operation that triggered the error.
Related Guides
Try it: Paste your error into our Error Diagnostic for an instant fix.