172.17.219.156:3000 and i can access that address locally on windows, again, not from other machines
WSL2 runs as a Hyper-V VM, and by default it is placed on a virtual network separate from your physical LAN. The host itself knows where the 172.17.219.x network is, but the rest of your LAN does not.
(Normally the host OS and the WSL2 VM also have their own separate 'localhost's, but WSL automatically forwards all 'localhost' connections from host to listeners on the guest to make it appear as a single system.)
It seems that you can configure WSL2 to use an "external" Hyper-V bridge instead, placing the VM directly in your physical network, as per this GitHub comment:
Example working .wslconfig
for localhost:
[wsl2]
# Bridged networking
networkingMode=bridged
vmSwitch=WSL_external
dhcp=true
# Turn off default connection to bind WSL 2 localhost to Windows localhost
localhostforwarding=true
and /etc/wsl.conf
[boot]
systemd=true
[network]
generateResolvConf = false
and /usr/lib/systemd/network/wsl_external.network
[Match]
Name=eth0
[Network]
Description=WSL
DHCP=true
Another approach that I've seen is to use Windows' built-in TCP proxy support via netsh interface portproxy
to have the host automatically forward certain connections to the guest.
localhost
does not go to the same address as your LAN IP address (it goes to 127.0.0.1 or ::1 instead). Servers can choose to accept connections either at all local addresses, or at only a specific one. Does the nodejs server show a "listening on <address>:<port>" when it starts? If not, find it innetstat -a -n -p tcp
and check what address it's on.netstat -a -n -p tcp
couldn't find anything under port 3000, i don't know how to read it...