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

fix WSL "connection refused" to the fake API #311

Merged
merged 3 commits into from
Oct 31, 2024

Conversation

jakecoffman
Copy link
Member

By default the CLI starts a fake API server which intercepts calls to a real API which allows the CLI to print output to stdout or a file.

Unfortunately on Linux, Docker won't allow a container to communicate with a server running on the host on 127.0.0.1, so we had to set it to 0.0.0.0.

Even more unfortunate, is on WSL which is a Linux variant, 0.0.0.0 doesn't work at all so we have to set it back to 127.0.0.1.

Using the info in microsoft/WSL#423 (comment) to detect WSL.

@jakecoffman jakecoffman requested a review from a team as a code owner April 26, 2024 13:25
@jakecoffman
Copy link
Member Author

@RobJellinghaus if you have a free moment, could you verify that this works in WSL without having to use the FAKE_API_HOST environment variable?

@jakecoffman jakecoffman added this pull request to the merge queue Oct 31, 2024
Merged via the queue into main with commit 725b27a Oct 31, 2024
70 checks passed
@jakecoffman jakecoffman deleted the support-wsl-out-of-the-box branch October 31, 2024 13:38
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.

2 participants