Geonode logo
Network errors

How to Fix ETIMEDOUT (Connection Timed Out)

Tell a dropped port from an old address or a skipped proxy setting, then apply the matching fix.

Updated

TL;DR

A connect ETIMEDOUT error means your operating system asked the IP and port in the message for a TCP connection and got no reply before it gave up. Allow that port on the firewall that drops it, or point your client at an address that answers.

What ETIMEDOUT looks like in each client

Captured against a silent local port; yours shows your own IP, port and wait time.

WhereWhat you see
Node.js http, https and netError: connect ETIMEDOUT 127.0.0.1:8443
Node.js 20 or later, host name with IPv6 and IPv4 addressesAggregateError [ETIMEDOUT]:
Node.js fetch, 10-second connect limit reachedTypeError: fetch failed ... [cause]: ConnectTimeoutError: Connect Timeout Error (attempted address: 127.0.0.1:8444, timeout: 10000ms)
npmnpm error network request to http://127.0.0.1:8443/left-pad failed, reason: connect ETIMEDOUT 127.0.0.1:8443
Python socket on macOSTimeoutError: [Errno 60] Operation timed out
curl (exit code 28)curl: (28) Failed to connect to 127.0.0.1 port 8443 after 7781 ms: Couldn't connect to server

Why this happens

Your computer knocked on that port, and nothing answered at all.

Firewalls and cloud security groups usually discard unwanted connection requests without replying, so your system resends the request several times, then gives up and reports ETIMEDOUT.

Diagnose your ETIMEDOUT first

Five checks that point to the hop that stayed silent, starting with the message itself.

  • Read the IP and port after ETIMEDOUT; if they are your proxy's, the proxy never answered, and any other address means a direct connection.

  • Switch from Wi-Fi to mobile data and retry; if it connects there, the first network filters that port, as some office and public networks do.

  • Run nc -vz with that IP and port on the same machine; if it also times out, the network drops the packets, not your code.

  • If curl reaches the URL but Node.js times out, run env | grep -i proxy; a match means curl used a proxy that Node.js skipped.

  • For your own cloud server, open the security group's inbound rules; if none allows your public IP on that port, you have found the block.

Solutions ranked by effectiveness

Start with the firewall, then the address, then how Node.js reaches the network.

  1. Most common fix

    Allow the port on the blocking firewall

    Applies when the port stays silent from every tool you try. The block sits on the server's side or at your network's edge, so open the port there.

    1. Look up your public IP, the address the server sees.

    2. In the server's cloud console or host firewall, allow that IP on the port.

    3. On office or school networks, ask IT to allow outbound traffic to that port.

  2. Check next

    Point the client at a live address

    Applies when the IP in the message is not the one the service uses today, such as an outdated DNS answer, a hard-coded IP or a retired proxy.

    1. Run nslookup on the host name and compare its answer with the error's IP.

    2. Replace hard-coded IPs in configs and scripts with the host name.

    3. For a proxy, check its host and port against your provider's current list.

  3. For developers

    Send Node.js through your network's proxy

    Applies when curl gets through but Node.js times out on a network that lets traffic out only via a proxy. Node.js reads proxy variables only after you switch that on.

    1. On Node.js 24.5+ or 22.21+, start the app with NODE_USE_ENV_PROXY=1 set.

    2. Earlier releases may skip it silently; use the undici package's fetch with a ProxyAgent instead.

Stop the ETIMEDOUT from coming back

Habits that keep addresses current, firewall rules complete and failures easy to trace.

  1. Lower the DNS TTL before moving a server, so cached records stop sending clients to the old IP.

  2. Leave Node.js's autoSelectFamily on; with it off, one silent IPv6 address can stall a connect until the system gives up.

  3. When allowing a proxy through a firewall, open its whole published port range rather than the single port you tested.

Proxy ports your IT can allowGeonode publishes fixed HTTP and SOCKS5 port ranges for an exact outbound firewall rule.
Try residential proxies

Related errors

Learn more

FAQ

Your system sent TCP connection requests to the IP and port shown and heard nothing back before its retry limit ran out. Nothing refused the connection; the requests were dropped or never reached a live machine.

It means no address behind the host name connected, and the first one stayed silent past Node.js's per-address wait, 250 ms in versions 20 to 24. Others may have failed another way, such as ECONNREFUSED; err.errors lists each.

It is the code of undici's ConnectTimeoutError, which Node.js fetch throws as the cause of TypeError: fetch failed when a connection, TLS handshake included, takes over 10 seconds. On Linux that timer fires long before the system's own limit.

Both reuse the code for their own timers. The got library's TimeoutError reads like Timeout awaiting 'request' for 5000ms, and axios switches timeout of 5000ms exceeded from ECONNABORTED to ETIMEDOUT when transitional.clarifyTimeoutError is true.

The system gave up on the TCP handshake: Linux numbers ETIMEDOUT 110, macOS uses 60 and Windows reports Winsock error 10060. A bare TimeoutError: timed out, with no number, means your own timeout value ran out first.

For a single address, Node.js's http and net set no connect timer, so the operating system decides. On Linux the default is 6 retries of the opening packet, roughly 127 seconds, which is why scripts seem to hang first.

A gateway for whitelisted IPs only

Geonode's secure France gateway refuses other addresses and is recommended for higher reliability.