Skip to content
MtrXTools

No connection could be made because the target machine actively refused it

Nothing is listening on that port

Seen in .NET (SocketException 10061), Python on Windows (WinError 10061), SQL Server clients

The host answered but refused the TCP connection (WSAECONNREFUSED, 10061), because no process is listening on that address and port.

Common causes

  • The service is not running or uses a different port.
  • The service listens only on localhost, but the client connects remotely.
  • A local proxy setting points at a proxy that is not running.

How to fix it

  1. Check the service is listening: netstat -ano | findstr :PORT on the server.
  2. Bind the service to the right interface and port.
  3. Check proxy settings (netsh winhttp show proxy, HTTP_PROXY) if the refused address is a proxy.
Check the port from outside

Got a different message? Paste it into the error explainer.

Related errors

All 32 Languages & runtimes errors