Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

185
Visualizações
Server crashes when making an API call
app.post("/", (req, res) => {
    const origin = req.body.origin;
    const destination = req.body.destination;
    const urlOri = "https://api.openweathermap.org/data/2.5/weather?q=" + origin + "&APPID={mykey}"
    https.get(urlOri, function (response) {
        console.log(response);
    })
});

I have written this code and I am getting this error:

Server started on port 443
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: connect ETIMEDOUT 178.128.25.248:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
Emitted 'error' event on ClientRequest instance at:
    at TLSSocket.socketErrorListener (_http_client.js:469:9)
    at TLSSocket.emit (events.js:315:20)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -4039,
  code: 'ETIMEDOUT',
  syscall: 'connect',
  address: '178.128.25.248',
  port: 443
}

This same code runs on one of my friend's pc same as expected, what to do?

I have tried to do the same via request and axios module as well and I got the same error.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Sorry guys I was using a proxy server. I disabled it and now it's working fine

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda