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 127.0.0.1 instead of localhost for OPENAI_API_BASE_URL #6

Merged

Conversation

jamiew
Copy link
Contributor

@jamiew jamiew commented Nov 16, 2023

On my recent-ish macOS, the OpenAI library seems to resolve localhost to ::1,
and my local web server isn't listening there

I suspect issue is somewhere else (maybe just my computer?) but this fixes it

On my recent-ish macOS, the OpenAI library seems to resolve localhost to ::1,
and my local web server isn't listening there

I suspect issue is somewhere else (maybe just my computer?) but this fixes it
@transitive-bullshit transitive-bullshit merged commit f6f2d76 into transitive-bullshit:main Nov 16, 2023
5 checks passed
@transitive-bullshit
Copy link
Owner

Thanks @jamiew 🙏

@evgyk
Copy link
Contributor

evgyk commented Dec 31, 2023

@transitive-bullshit - Regarding the todo of understand why localhost wan't working:
First I'd suggest using 0.0.0.0 as it'll always work.
127.0.0.1 is also nice but 0.0.0.0 gives you the ability to use it over your network and not only on one pc.
localhost wasn't working because apparently it wan't set in /etc/hosts ;)

@jamiew
Copy link
Contributor Author

jamiew commented Dec 31, 2023

0.0.0.0 is a little dangerous as it opens you up to external network which may not have been the intention

iirc the localhost issue was ipv6 vs ipv4 related -- one was using ::1 (ip6) vs. localhost which mapped to ipv4. So explicitly using an ipv4 address fixed it

@jamiew jamiew deleted the use-explicit-localhost-ip branch December 31, 2023 14:06
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.

None yet

3 participants