Source: https://docs.microsoft.com/en-us/windows/wsl/networking
If you have a server listening on port 5050, running inside WSL2.
Run ip addr | grep eth0
. You'll get a line similar to this:
inet 172.29.25.111 **************
Then from PowerShell, run:
netsh interface portproxy add v4tov4 listenport=5050 listenaddress=0.0.0.0 connectport=5050 connectaddress=172.29.25.111
Assuming your Windows host's local IP address is 192.168.1.x, you'll be able to access the server via http://192.168.1.x:5050.
*You might have to open a port on the firewall (Windows Defender) too. https://pureinfotech.com/open-port-firewall-windows-10/