Skip to content

Instantly share code, notes, and snippets.

@juniormartinxo
Last active July 7, 2022 14:19
Show Gist options
  • Select an option

  • Save juniormartinxo/54ab397090fe3540153535f3962859c2 to your computer and use it in GitHub Desktop.

Select an option

Save juniormartinxo/54ab397090fe3540153535f3962859c2 to your computer and use it in GitHub Desktop.

Error: connect ECONNREFUSED 127.0.0.1:80 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16)

Stackoverflow (Obtendo a conexão ECONNREFUSED 127.0.0.1:80 ao tentar uma solicitação HTTP)

Acesse aqui

No meu caso, o problema era realmente o comportamento padrão do cliente HTTP que eu estava usando, axios. Por padrão, o axios nos redireciona 127.0.0.1:80se não encontrar o URL ou httpmétodo solicitado (GET/POST/PUT). Portanto, é melhor verificar sua URL se também estiver usando axios.

No NestJS o HttpService do axios possui o mesmo comportamento, verifique se a url foi passada!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment