1 year ago

#341393

test-img

Constantin Goeldel

Node.js how to stop all outgoing requests from timing out?

I've been setting up my Raspberry Pi as a web server and everything worked fine until yesterday, when every node process started timing out when doing external requests.

For example: npm i -g n (The node version manager) times out when fetching the ideal tree, and my express applications can't make calls to external APIs, but requests to the server work perfectly. When doing the same outgoing calls with curl, everything works fine. Only Node.js processes seem to have this problem.

Any tips on where to look for the problem? Is it firewall related?

Not working:

  • Expected npm i -g n to install the package, instead it times out. enter image description here.
  • All external calls made by a node process time out with reason connect ETIMEDOUT

Working:

  • curl to external resources, so connection is acctive
  • Requests to an express server from clients work as usual
  • Responses from the express server work if there are no external api calls involved
  • cloudflare tunnels and access for ssh work.

node.js

linux

networking

server

connection-timeout

0 Answers

Your Answer

Accepted video resources