Skip to content

Instantly share code, notes, and snippets.

@engalar
Last active May 10, 2022 08:45
Show Gist options
  • Save engalar/cfb8dbde4e84a34c60ca2a8ef31892d1 to your computer and use it in GitHub Desktop.
Save engalar/cfb8dbde4e84a34c60ca2a8ef31892d1 to your computer and use it in GitHub Desktop.
windows wsl proxy localhost
export all_proxy=http://host.docker.internal:29759
New-NetFirewallRule -DisplayName "Allow Inbound Port 29759" -Direction Inbound -LocalPort 29759 -Protocol TCP -Action Allow
@echo off&(cd/d "%~dp0")&(cacls "%SystemDrive%\System Volume Information" >nul 2>&1)||(start "" mshta vbscript:CreateObject^("Shell.Application"^).ShellExecute^("%~snx0"," %*","","runas",1^)^(window.close^)&exit /b)
netsh interface portproxy reset
netsh interface portproxy show all
netsh interface portproxy add v4tov4 listenport=29759 listenaddress=host.docker.internal connectport=29758 connectaddress=127.0.0.1
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment