DEV Community

Cover image for Building custom socks5 for VsCode and other development tools
navid rezadoost
navid rezadoost

Posted on

Building custom socks5 for VsCode and other development tools

Only VSCode Uses the VPN — The Rest of Your Computer Stays Chill

How I stopped turning my whole laptop into a VPN zombie just to install a single extension

If you're reading this, you probably know the pain.

You're in a country (or a corporate network) where half the internet is blocked.

GitHub? Blocked.

VSCode Marketplace? Nope.

NPM/PyPI? Good luck.

So you fire up your VPN… and suddenly:

  • Your colleagues can't reach localhost:3000 anymore
  • Your Android emulator thinks you're in the US
  • Your banking app freaks out
  • Your 300 Mbps connection turns into a potato

Been there. Done that. Hated it.

So I built something better: a tiny set of scripts that puts only VSCode (and whatever else you want) behind the VPN, while everything else keeps your real IP and full local network access.

Meet → vscode-socks5-namespace

The dream setup

  • Browser → real IP ✓
  • Discord → real IP ✓
  • Local dev server → accessible to teammates ✓
  • Docker → real IP ✓
  • Banking app → doesn't hate you ✓
  • VSCode → happily downloading extensions through VPN ✓
  • Git clone → works ✓
  • NPM install → no more "network timeout" ✓

How does it actually work?

On Linux (the hero platform):

We create a completely separate network namespace, spin up OpenVPN + a SOCKS5 proxy (Dante) inside it, then punch a tiny hole so your host can talk to that proxy.

Result? True isolation. Zero leaks. Your host doesn't even know a VPN exists.

On Windows: Same thing, but inside WSL2 (yes, it works perfectly).

On macOS: We do the best we can with routing + SOCKS (no real namespaces, sorry Apple).

30-second test drive (Linux)

git clone https://github.com/navidrezadoost/vscode-socks5-namespace.git
cd vscode-socks5-vpn-namespace/linux/Ubuntu    # or your distro
./connect.sh
Enter fullscreen mode Exit fullscreen mode

It will:

Detect your interface & IP automatically
Ask for your .ovpn file (absolute path!)
Offer to install missing packages
Connect the VPN in an isolated namespace
Start a SOCKS5 proxy
Forward it to your host
Optionally launch VSCode with the proxy

When it's done you get something like:

Proxy address: socks5://10.200.200.2:1081
Your public IP through proxy: 185.102.34.567  ← VPN IP
Your real public IP: 89.42.123.456           ← unchanged
Enter fullscreen mode Exit fullscreen mode

Just launch VSCode like this forever:

code --proxy-server="socks5://10.200.200.2:1081"
Enter fullscreen mode Exit fullscreen mode

Or make it permanent with a tiny desktop shortcut/alias.
Want git and terminal tools too?

git config --global http.proxy socks5://10.200.200.2:1081
curl --socks5-hostname 10.200.200.2:1081 https://ipinfo.io
Enter fullscreen mode Exit fullscreen mode

Real-life use cases (why people actually love this)

  1. Iran, Turkey, Russia, corporate offices → Access dev resources without breaking local stuff
  2. Pentesters on Kali/Parrot → Keep your recon traffic on one VPN and your IDE on another
  3. Privacy nerds → Only route work traffic through VPN, keep personal stuff direct
  4. Multiple VPNs at once → Run three namespaces with three different providers. No conflicts.

Current status

  • Linux: Rock solid on 15+ distros (Ubuntu, Arch, Fedora, Kali, etc.)
  • Windows (via WSL2): Full isolation, works great
  • macOS: Works, but limited (no real namespaces)

All the ugly distro-specific package names and quirks are handled for you.
Try it, seriously
If you've ever screamed at your computer because you just wanted to install one VSCode extension without disconnecting from your local dev server… this is for you.
https://github.com/navidrezadoost/vscode-socks5-namespace/tree/main
Star it if it saves your sanity. PRs welcome (especially more distro support!).
And yes — this whole thing was built because I got tired of choosing between "can code" and "can demo my code to colleagues" every single day.
You're welcome
P.S. To everyone still copy-pasting export http_proxy=socks5://127.0.0.1:1080 into every terminal tab in 2025… come to the light

This version is perfect for dev.to (casual, relatable, meme-friendly) and also works great on Medium. It focuses on the problem, the emotions, and the "aha!" moment — exactly what readers love.
Go post it and watch the stars roll in

Top comments (0)