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

Localhost DNS lookup fails without network connection #524

Open
MichelJansson opened this issue Aug 26, 2024 · 1 comment
Open

Localhost DNS lookup fails without network connection #524

MichelJansson opened this issue Aug 26, 2024 · 1 comment

Comments

@MichelJansson
Copy link

Hi! Thanks again for the lib!

I mostly use this library on windows to connect to a local server via "wss://localhost". This normally works fine, but when not connected to a network (network cable unplugged and not connected to wifi), IXWebsockets fails to connect to my server.

I tracked it down to failing DNS lookup of localhost. Digging into the code, I see getaddrinfo is configured not to do lookups when a with only a loopback address available (hint AI_ADDRCONFIG is set):

hints.ai_flags = AI_ADDRCONFIG | AI_NUMERICSERV;

As a workaround I tested to remove that flag and my program started working as expected.

I'm not proficient in winsock etc, so I can't tell if there any specific reason for the flag to be set for the library or can it be removed or made configurable?

Thanks!

@bsergean
Copy link
Collaborator

Hey a quick workaround too is to try

wss://127.0.0.1 instead of localhost

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

No branches or pull requests

2 participants