Created
January 23, 2022 16:49
-
-
Save nowk/fca3f8f9290f1e79932b3f7b268de600 to your computer and use it in GitHub Desktop.
Quick portproxy on wsl2 (PowerShell only)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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