Score:0

All tcp ports are not reachable on localhost (MacOS 13.4)

mn flag

A friend of mine asked for help, basically any app listening on some local tcp port on localhost can't be reached. For example a node.js server running on port 8080 or 3000. Executing the command sudo lsof -i -P | grep LISTEN | grep 8081 gives:

node      3109 someuser   23u  IPv6 0x4b0c58c629ba9f33      0t0    TCP *:8080 (LISTEN)

so it seems the app is correctly listening on that port. But when trying to reach the app on localhost:8080 it says that it can't be reached or give timeout. We have tried many different ports (e.g. 8080, 3000, 5000 etc) checking in case the ports were already used by other apps but we got always the same error. We also tried this http-server package but same result. I've never had a case where all the tcp ports are unresponsive locally, do you have any idea what's going on?

ph flag
That `lsof` output indicates it's only listening over IPv6, but the client is probably trying to reach it over IPv4 (`localhost` resolves to *both* the IPv4 and IPv6 loopback addresses). Either get the service to listen over both IP versions, or force the client to use IPv6.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.