Ran into this issue where all of a sudden I could not connect to localhost from Chrome. It was working and then all of a sudden it stopped working. It (Chrome) just hangs waiting for response from server. I was able to make curl requests successfully. What gives? Turned out to be a WSL issue (bug) in my case. Sometimes something inside WSL crashes and it stops the networking. The fix is to shutdown WSL and start it again:
wsl --shutdown
The curl request was working because I was running it inside WSL. If I ran curl from Windows it gave same error.
Lately I have been seeing this happen more often so making a note to self.