/usual-setup.ps1 Secret
Last active
December 17, 2020 13:36
Star
You must be signed in to star a gist
Port forwarding in shadow-cljs + RN + WSL2
This file contains 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
# In a powershell w/admin rights: | |
netsh interface portproxy reset v4tov4 | |
$WSL_CLIENT = bash.exe -c "ifconfig eth0 | grep 'inet '"; | |
$WSL_CLIENT -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; | |
$WSL_CLIENT = $matches[0]; | |
$MYIP = (Test-Connection -ComputerName (hostname) -Count 1).IPV4Address.IPAddressToString | |
iex "netsh interface portproxy add v4tov4 listenport=8081 listenaddress=127.0.0.1 connectport=8081 connectaddress=$WSL_CLIENT" | |
iex "netsh interface portproxy add v4tov4 listenport=9630 listenaddress=$MYIP connectport=9630 connectaddress=$WSL_CLIENT" | |
iex "netsh interface portproxy add v4tov4 listenport=8890 listenaddress=$MYIP connectport=8890 connectaddress=$WSL_CLIENT" | |
iex "netsh interface portproxy add v4tov4 listenport=53 listenaddress=$MYIP connectport=53 connectaddress=$WSL_CLIENT" | |
netsh advfirewall firewall add rule name="Open Port 9630" dir=in action=allow protocol=TCP localport=9630 | |
netsh advfirewall firewall add rule name="Open Port 9630" dir=out action=allow protocol=TCP localport=9630 | |
netsh advfirewall firewall add rule name="Open Port 8890" dir=in action=allow protocol=TCP localport=8890 | |
netsh advfirewall firewall add rule name="Open Port 8890" dir=out action=allow protocol=TCP localport=8890 | |
netsh interface portproxy show v4tov4 | |
adb kill-server | |
adb -a nodaemon server start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment