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

Bug Accessing Localhost with Node.js >= 17 #31

Open
chsami opened this issue Apr 8, 2024 · 0 comments
Open

Bug Accessing Localhost with Node.js >= 17 #31

chsami opened this issue Apr 8, 2024 · 0 comments

Comments

@chsami
Copy link

chsami commented Apr 8, 2024

Description:
There's a current issue with Node.js versions 17 and above where using localhost in URLs for HTTP requests results in failure, whereas using 127.0.0.1 works as expected. This issue is documented and tracked in the Node.js GitHub repository (nodejs/node#40702).

Problem Statement:
Due to this issue, accessing endpoints like http://localhost:11434/api/generate in Node.js >= 17 fails to resolve properly.

Solution (Temporary Fix):
A temporary fix is to replace localhost with 127.0.0.1 in the URL to ensure proper resolution. For example:

http://127.0.0.1:11434/api/generate

Proposed Improvement:
It would be beneficial to have the ability to specify the endpoint URL through command-line arguments or configuration settings until the underlying issue in Node.js is resolved. This would allow users to easily adapt to this change without modifying the code.

Request:
Could a change be implemented to allow users to specify their own endpoint URLs through arguments or configuration settings? Alternatively, consider updating the code to replace localhost with 127.0.0.1 internally until the Node.js issue is resolved.

Additional Context:
I've implemented a local fix in my repository, but having this addressed at the project level would greatly benefit other users encountering the same issue.

Thanks!

image

@chsami chsami changed the title Issue: Difficulty Accessing Localhost with Node.js >= 17 Bug Accessing Localhost with Node.js >= 17 Apr 8, 2024
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

1 participant