Skip to content

Instantly share code, notes, and snippets.

@nowk
Created January 23, 2022 16:49
Show Gist options
  • Save nowk/fca3f8f9290f1e79932b3f7b268de600 to your computer and use it in GitHub Desktop.
Save nowk/fca3f8f9290f1e79932b3f7b268de600 to your computer and use it in GitHub Desktop.
Quick portproxy on wsl2 (PowerShell only)
$ports = 80,3000,9000,9090,9100,9999
$wslIP = $(wsl hostname -I).Split(" ")[0]
Foreach ($i in $ports)
{
echo "Creating portyproxy port $i on $wslIp";
netsh interface portproxy add v4tov4 listenport=$i listenaddress=0.0.0.0 connectport=$i connectaddress=$wslIP;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment