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.
| Where | What you see |
|---|---|
| Node.js http, https and net | Error: connect ETIMEDOUT 127.0.0.1:8443 |
| Node.js 20 or later, host name with IPv6 and IPv4 addresses | AggregateError [ETIMEDOUT]: |
| Node.js fetch, 10-second connect limit reached | TypeError: fetch failed ... [cause]: ConnectTimeoutError: Connect Timeout Error (attempted address: 127.0.0.1:8444, timeout: 10000ms) |
| npm | npm error network request to http://127.0.0.1:8443/left-pad failed, reason: connect ETIMEDOUT 127.0.0.1:8443 |
| Python socket on macOS | TimeoutError: [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.
- 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.
Look up your public IP, the address the server sees.
In the server's cloud console or host firewall, allow that IP on the port.
On office or school networks, ask IT to allow outbound traffic to that port.
- 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.
Run nslookup on the host name and compare its answer with the error's IP.
Replace hard-coded IPs in configs and scripts with the host name.
For a proxy, check its host and port against your provider's current list.
- 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.
On Node.js 24.5+ or 22.21+, start the app with NODE_USE_ENV_PROXY=1 set.
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.
Lower the DNS TTL before moving a server, so cached records stop sending clients to the old IP.
Leave Node.js's autoSelectFamily on; with it off, one silent IPv6 address can stall a connect until the system gives up.
When allowing a proxy through a firewall, open its whole published port range rather than the single port you tested.
Related errors
Learn more
FAQ
A gateway for whitelisted IPs only
Geonode's secure France gateway refuses other addresses and is recommended for higher reliability.


