Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use localhost instead of 0.0.0.0 for local connections #300

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sangaline
Copy link

This addresses the issue in #296. Connecting to 0.0.0.0 only works on Linux, it results in PROXY_TO_PROXY_SOCKET_ERROR on : Error: connect ECONNREFUSED errors on MacOS and Windows. There's some discussion of this in nodejs/node#14900. This PR changes the target host from 0.0.0.0 to localhost in order to make it more cross-platform compatible.

@Apollon77
Copy link
Contributor

Hm ... waaaiiitt ... It's not that easy!

Nodejs 18 changed the order of node.js dns lookups to resolve IPv6 over IPv4. When you change it to localhost then you most likely end up in ipv6 only ... so this change might have other side effects and should be considered carefully.

Right binding to 0.0.0.0 means "bind ipv4 only". I do not know what happens if you bind to localhost ... does that now (nodejs 18+) mean you bind ipv6 only? or some mixture?

@doaortu
Copy link

doaortu commented Aug 20, 2024

what about 127.0.0.1 ? it resolve to localhost and ipv4.
I can't say it will work on windows tho, I don't use windows to do development work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants