AnWeber / vscode-httpyac

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=anweber.vscode-httpyac
MIT License
222 stars 20 forks source link

Wrong request host #242

Closed maicss closed 7 months ago

maicss commented 7 months ago
GET http://localhost:3000/api/hello-world

When click to execute it, gives an error:

connect ECONNREFUSED 127.0.0.1:3000

Environment: follow https://nuxt.com/docs/getting-started/installation#development-server, create a folder in server named api, and a js file name hello-world

When I change package.json -> scripts -> dev -> nuxt dev to package.json -> scripts -> dev -> nuxt dev --host, request success.

Expectation: request to localhost not 127.0.0.1

AnWeber commented 7 months ago

@maicss It is a NodeJS issue but I have no solution at the moment. I will link some docs

see #125

same error in rest-client

maicss commented 7 months ago

Wow, Thank you, can you update this limit to readme? That will helps other who have the same problem.

AnWeber commented 7 months ago

@maicss I'm just not 100% sure how the error is triggered. I have only seen similar errors in rest-client and postman issue log. I think it is internally related to DNS. In the debuggable code the host was still localhost. Either it is internal to NodeJS or at the DNS level. But since it affects different systems, I tend to NodeJS. But all without guarantee.

Could also be proxy: https://stackoverflow.com/questions/49130558/postman-cant-reach-localhost