Kong / insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
https://insomnia.rest
Apache License 2.0
34.35k stars 1.93k forks source link

[FIXED] MacOS - Could not resolve host: example.localhost using jwilder/nginx-proxy #4445

Open zolthan opened 2 years ago

zolthan commented 2 years ago

Currently I have the problem, that Insomnia can't connect to localhost domains provided by the docker container nginx-proxy.

* Preparing request to https://examle.localhost/api/variants/1575?useNumberAsId=true
* Current time is 2022-02-04T07:14:46.541Z
* Using libcurl/7.73.0 OpenSSL/1.1.1k zlib/1.2.11 brotli/1.0.9 zstd/1.4.9 libidn2/2.1.1 libssh2/1.9.0 nghttp2/1.42.0
* Using default HTTP version
* Disable timeout
* Enable automatic URL encoding
* Disable SSL validation
* Enable cookie sending with jar of 6 cookies
* Could not resolve host: example.localhost
* Closing connection 2

Calling this URL by browser (Chrom, Firefox or Safari) works properly.

OS: MacOS Monterey 12.2 insomnia:

Version: Insomnia 2021.7.2
Release date: 12/9/2021
OS: Darwin x64 21.3.0
Electron: 11.2.3
Node: 12.18.3
V8: 8.7.220.31-electron.0
Architecture: x64
node-libcurl: libcurl/7.73.0 OpenSSL/1.1.1k zlib/1.2.11 brotli/1.0.9 zstd/1.4.9 libidn2/2.1.1 libssh2/1.9.0 nghttp2/1.42.0

Using https://github.com/nginx-proxy/nginx-proxy for localhost development.

wongstein commented 2 years ago

Hi! Thanks for the report. @zolthan I see in the logs that " https://examle.localhost/api/variants/1575?useNumberAsId=true" is being called. You'll notice the host name is "examle.localhost" (it's missing a 'p') not "example.localhost". Can you confirm the error is still present when the host name is "example.localhost"?

zolthan commented 2 years ago

Hi Amé,

Yes. Sorry this was just a typo when I was changing the original domain. The problem still exists.

Best Z

Von meinem iPhone gesendet

Am 04.02.2022 um 16:30 schrieb Amé Wong @.***>:

 Hi! Thanks for the report. @zolthan I see in the logs that " https://examle.localhost/api/variants/1575?useNumberAsId=true" is being called. You'll notice the host name is "examle.localhost" (it's missing a 'p') not "example.localhost". Can you confirm the error is still present when the host name is "example.localhost"?

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

matthewcaminiti commented 2 years ago

Bumping thread as this also happens on my machine when trying to hit a local: http://foo.bar.localhost/... Unable to find a way to get Insomnia to hit local dns.

OS: MacOS Monterey 12.3.1

Version: 2022.3.0 Build date: 4/28/2022 OS: Darwin x64 21.4.0 Electron: 17.3.1 Node: 16.13.0 V8: 9.8.177.13-electron.0 Architecture: x64

curl: 7.79.1, libcurl/7.79.1, LibreSSL/3.3.5 zlib/1.2.11 nghttp2/1.45.1

gppleton-platform commented 2 years ago

Workaround is to create a "127.0.0.1 example.localhost" record to your /etc/hosts file

wongstein commented 1 year ago

Renaming this issue as fixed.