Useful or not, from you.
WSL Can not access Linux networking apps from Windows with localhost when use IPv6 for port binding
  • Windows build number:
    Microsoft Windows [版本 10.0.18963.1000]

  • I can connect to the wsl2 with localhost when use ipv6 for port binding

In wsl2

root@DESKTOP-H57S2QH:~# netstat -nlpt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:89              0.0.0.0:*               LISTEN      1664/php
tcp6       0      0 :::3306                 :::*                    LISTEN      1134/docker-proxy
tcp6       0      0 :::80                   :::*                    LISTEN      1146/docker-proxy
tcp6       0      0 :::59878                :::*                    LISTEN      1158/docker-proxy

root@DESKTOP-H57S2QH:~# curl -I http://localhost:89/
HTTP/1.1 404 Not Found
Host: localhost:89
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: 533

root@DESKTOP-H57S2QH:~# curl -I http://localhost/
HTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Thu, 22 Aug 2019 09:18:48 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive

In Windows

C:\Users\honking>curl -I http://localhost:89/
HTTP/1.1 404 Not Found
Host: localhost:89
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: 533


C:\Users\honking>curl -I http://localhost/
curl: (56) Recv failure: Connection was aborted

C:\Users\honking>netstat -ant | find "LISTEN"
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:1080           0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:2179           0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:5040           0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:7680           0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:49664          0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:49665          0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:49666          0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:49667          0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:49668          0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:49671          0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:49674          0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:55947          0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:89           0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:4012         0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:4013         0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:4300         0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:4301         0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:5354         0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:27015        0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:49350        0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:49351        0.0.0.0:0              LISTENING       InHost
  TCP    172.22.160.1:139       0.0.0.0:0              LISTENING       InHost
  TCP    172.24.32.1:139        0.0.0.0:0              LISTENING       InHost
  TCP    172.25.16.1:139        0.0.0.0:0              LISTENING       InHost
  TCP    172.28.224.1:139       0.0.0.0:0              LISTENING       InHost
  TCP    172.29.48.1:139        0.0.0.0:0              LISTENING       InHost
  TCP    172.29.176.1:139       0.0.0.0:0              LISTENING       InHost
  TCP    192.168.0.42:139       0.0.0.0:0              LISTENING       InHost
  TCP    [::]:135               [::]:0                 LISTENING       InHost
  TCP    [::]:445               [::]:0                 LISTENING       InHost
  TCP    [::]:2179              [::]:0                 LISTENING       InHost
  TCP    [::]:7680              [::]:0                 LISTENING       InHost
  TCP    [::]:49664             [::]:0                 LISTENING       InHost
  TCP    [::]:49665             [::]:0                 LISTENING       InHost
  TCP    [::]:49666             [::]:0                 LISTENING       InHost
  TCP    [::]:49667             [::]:0                 LISTENING       InHost
  TCP    [::]:49668             [::]:0                 LISTENING       InHost
  TCP    [::]:49671             [::]:0                 LISTENING       InHost
  TCP    [::]:49674             [::]:0                 LISTENING       InHost
  TCP    [::1]:80               [::]:0                 LISTENING       InHost
  TCP    [::1]:3306             [::]:0                 LISTENING       InHost
  TCP    [::1]:59878            [::]:0                 LISTENING       InHost
  • I can connect the ports listen on tcp both on wsl2 and windows , but the ports listen on tcp6 can't
That's a useful answer
Without any help

Could you please take some networking logs for this issue? It will help us diagnose what's going on.

You can find instructions on how to do so here!

EDIT: I'm also unable to repro your issue. This means it may be related to some config other than WSL.

P.S: I also hope you don't mind that I used your issue as an example for the networking log collection process!

I can not submit the logs by the instructions. The Feedback hub keeps showing "数据尚在收集中。这可能需要一点时间".

After waiting for about 15 minutes, I had to submit it directly. It seems that only the screenshot was submitted but there is no log.