'Cannot access to WSL2 port opened via IPv6 from Windows host

I have a node-server running at WSL2 Ubuntu-20.04.

netstat -tulpn in WSL shows the following ports: enter image description here

The ports specified as 0.0.0.0:8080 can be accessed in both WSL and Windows via 127.0.0.1:8080 url

My issue is that the ports specified as :::3006 can be accessed via 127.0.0.1:3006 only inside WSL, but from Windows, it works only via the network URL like http://172.28.100.200:3006.

When I send the request to 127.0.0.1:3006 from Windows, there is no connection error, but the server inside WSL does not receive it while using the network address, it does.

How can I investigate this and make the Windows port at 127.0.0.1:3006 forward requests into the same port in WSL?

UPDATE:

So I solved this by adding a port proxy, but again, WSL network IP is needed for this to work: enter image description here

Any chance to avoid using network IP?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source