ERR_CONNECTION_REFUSED — what it means and how to fix it

Unlike a timeout, “refused” is an answer: your browser found the address, knocked, and something actively turned it away. Either nothing is listening there (the site or server is down), or a firewall, proxy, or security program in between is doing the refusing.

The fix, in order

  1. Check whether the site is down for everyone. Open it on your phone with Wi-Fi off. If it’s refused there too, the site itself is down — waiting is the fix.
  2. Reload after a minute and clear the browser cache. A restarting server refuses connections briefly, and browsers can hold onto the failure.
  3. Turn off VPN and proxy briefly. A dead proxy refuses everything. Windows: Settings → Network & internet → Proxy — make sure no manual proxy is set that you didn’t put there.
  4. Check your firewall/antivirus web shield. Temporarily pause it and retest; if the site loads, add an exception rather than leaving protection off.
  5. Restart your router if many sites refuse at once — a wedged router can refuse on behalf of the whole network.

If it’s your own project (localhost)

“localhost refused to connect” almost always means the dev server isn’t running, or it’s running on a different port than the one in the address. Start the server, read the exact URL it prints (for example http://localhost:5173), and use that — port included. If the port is taken by another process, see EADDRINUSE.

If it still happens

If one site refuses on every device and network for a day or more, the service itself has a problem or has closed. If every site refuses on one PC only, scan for malware — rogue proxies installed by adware produce exactly this symptom.

Common questions

What’s the difference between ERR_CONNECTION_REFUSED and a timeout? Refused is an immediate “no” from the other end or a middlebox. A timeout means no answer at all arrived. They point at different causes, which is why the fixes differ.

Can my internet provider cause ERR_CONNECTION_REFUSED? Yes, if its proxy or filtering refuses the connection — the phone test (mobile data vs Wi-Fi) tells you whether it’s network-specific.

Related errors

DNS_PROBE_FINISHED_NXDOMAIN · EADDRINUSE — port already in use · 502 Bad Gateway