question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Try all available addresses when connecting to localhost (127.0.0.1 and ::1)

See original GitHub issue

In node v17 (specifically https://github.com/nodejs/node/pull/39987), we switched the default ordering of dns entries to follow what the OS is providing us vs reordering to put IPv4 addresses always first. This creates quite a few issues for folks as some tools only listen to 127.0.0.1 and not ::1.

I think we should try multiple addresses when dealing with localhost when establishing a new connection.

Originaklly reported as https://github.com/nodejs/undici/issues/1248.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
KhafraDevcommented, Dec 3, 2022

Should we enable it by default? Agents should be able to set this option already, under connect in options.

1reaction
mcollinacommented, Nov 26, 2022

Yes, we’d need to enable that setting once it lands.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is 127.0 0.1, Localhost, or a Loopback Address?
127.0.0.1 is special among IP addresses. Typically, an IP address is unique to every computer on both your local network and the internet....
Read more >
What is localhost? How to connect to 127.0.0.1 - IONOS
Localhost (127.0.0.1). When you (or your computer) call an IP address, you are usually trying to contact another computer on the internet.
Read more >
localhost/127.0.0.1:8080 - Connection refused - Stack Overflow
I am using xampp apache server to serve resources to the application from my machine. But i am getting the above error. I...
Read more >
What Is the 127.0.0.1 IP Address? - Lifewire
The IP address 127.0.0.1 is a special-purpose IPv4 address and is called the localhost or loopback address. All computers use this address ......
Read more >
The Difference Between 127.0.0.1 and Localhost - Baeldung
So why do we need to establish a connection with the originating device? In some cases, we would want to validate the Internet...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found