-
Notifications
You must be signed in to change notification settings - Fork 73
Description
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!
