cli icon indicating copy to clipboard operation
cli copied to clipboard

fix WSL "connection refused" to the fake API

Open jakecoffman opened this issue 1 year ago • 1 comments

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 https://github.com/microsoft/WSL/issues/423#issuecomment-221627364 to detect WSL.

jakecoffman avatar Apr 26 '24 13:04 jakecoffman

@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 avatar May 08 '24 15:05 jakecoffman