thunderclient / thunder-client-support

Thunder Client is a lightweight Rest API Client Extension for VS Code.
https://www.thunderclient.com
Other
3.62k stars 127 forks source link

Local Caddy with Https not working "Couldn't resolve the hostname to an IP address" #1465

Closed BilalBudhani closed 6 months ago

BilalBudhani commented 7 months ago

Question:

Hello, I'm running the Caddy server locally to proxy a project with multiple subdomains.

While I'm able to open Caddy configured domain project.localhost in the browser and via curl in the terminal. However, I'm unable to query it via Thunder Client.

I get the following error

image

I tried changing the underlying http-library as recommended in other issues but no success

image

What am I missing?

Are you using the free version/paid version/trial:

rangav commented 7 months ago

Hi @BilalBudhani

try these solutions https://github.com/rangav/thunder-client-support/blob/master/docs/common-issues.md

BilalBudhani commented 7 months ago

Thanks for response @rangav

I'm actually sending requests to a subdomain like api.project.localhost which is why I can't send it via 0.0.0.0 or any other local IP.

rangav commented 7 months ago

@BilalBudhani I have implemented a fix in v2.17.2, can you please test it and let me know if it's working or not?

How to use

  1. Update Extension to v2.17.2
  2. From Vs Code Settings Enable setting Preview Features ( see screenshot below)
  3. Change Http Libary to Axios in Vs Code setting
  4. Now test the localhost URL and let me know your feedback.
Screenshot 2024-01-31 at 16 25 07
BilalBudhani commented 7 months ago

Hey @rangav I appreciate you looking into this issue. I tried following all the above mentioned steps but unfortunately, the problem persists.

image image
rangav commented 7 months ago

Thanks for testing, can share logs data in output window if possible

Screenshot 2024-02-01 at 10 24 51
BilalBudhani commented 7 months ago

Here it is

---------------- Running Request: ----------------
Environment Used: development (Active)
Request Url: https://api.project.localhost/v2/path
Method: GET
Request Headers:
{
  "Accept": "*/*",
  "User-Agent": "vscode",
  "x-api-key": "[redacted]"
}
Request Body:
{
  "uuid": "[redacted]"
}

I guess there ain't much to work with

rangav commented 7 months ago

I have updated the code again to fix localhost issues in update v2.17.5

Can you test again with axios and got and let me know your feedback.

You can use the DNS Test command to verify the IP used https://github.com/rangav/thunder-client-support/releases/tag/v2.17.5

Please test and let me know your feedback.

rangav commented 6 months ago

Closing this issue let me if you still have any problems