Access WSL ports Over Lan

Search for a command to run...

No comments yet. Be the first to comment.
CRA has been one of my favorite tool. It gave us superpower to spin up react app with out of the box support for eslint , postcss , testing library,Web vitals and many more.. Since CRA has been depreciated and now React team recommend using framework...

If you often use the Zsh shell, at some point, you've probably encountered the frustrating issue of a corrupt history file. This problem can happen suddenly and disrupt your workflow by causing errors when you try to view or search your command histo...
![Troubleshooting [zsh: Corrupt History File]: A Simple Guide for Windows, Linux, macOS](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fstock%2Funsplash%2FxbEVM6oJ1Fs%2Fupload%2F160b183e50d491e945ca5ecb02f01896.jpeg&w=3840&q=75)
Commit Message Formats <type>(<optional scope>): <description> empty separator line <optional body> empty separator line <optional footer> Inital Commit chore: init Types API relevant changes feat Commits, that adds or remove a new feature fix C...

const shareData = { title: "au.mirza", url: "https://www.instagram.com/au.mirza" }; const btn = document.getElementById("share"); btn.addEventListener("click", shareHandler); function shareHandler() { if (navigator.share && navigator.canShare...

$remoteport = bash.exe -c "ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}
#[Ports]
#All the ports you want to forward separated by coma
$ports=@(80,443,3000,,5000,6000,8000,8080);
#[Static ip]
#You can change the addr to your ip config to listen to a specific address
$addr='0.0.0.0';
$ports_a = $ports -join ",";
#Remove Firewall Exception Rules
iex "Remove-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' ";
#adding Exception Rules for inbound and outbound Rules
iex "New-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' -Direction Outbound -LocalPort $ports_a -Action Allow -Protocol TCP";
iex "New-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' -Direction Inbound -LocalPort $ports_a -Action Allow -Protocol TCP";
for( $i = 0; $i -lt $ports.length; $i++ ){
$port = $ports[$i];
iex "netsh interface portproxy delete v4tov4 listenport=$port listenaddress=$addr";
iex "netsh interface portproxy add v4tov4 listenport=$port listenaddress=$addr connectport=$port connectaddress=$remoteport";
}
This is a simple PowerShell script, which I found on HackerNoon.
npx expose-wsl@latest