Created
March 17, 2023 02:07
-
-
Save xbalaji/21077cdf9af026a39e2097d5a59fc02e to your computer and use it in GitHub Desktop.
wsl_host_port_forward.ps1
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
ip = wsl -- ip -o -4 -json addr list eth0 | python3 -c "import sys,json; print(json.load(sys.stdin)[0]['addr_info'][0]['local'])" | |
netsh interface portproxy add v4tov4 listenport=$port listenaddress=0.0.0.0 connectport=$port connectaddress=$ip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment