Connecting To 127.0.0.1…Could not open connection to the host, on port 8123: Connect failed
Well aware this has been asked, but I have scoured Google/StackOverflow and tried every single suggested solution, without being able to connect to port 8123 on my local (which is running Windows 10). It is worth noting that I CAN connect when I use port 8080. But I need 8123 to run a legacy application that has the port hardcoded in many (random) places...I have done the following:
- Created and Inbound rule through my firewall for the port (and an outbound rule just in case).
- Tried turning off the firewall and Window's Defender.
- Used
netstat -an | findstr "8123"
to see if it is in use (not found). - Used
netstat -aon | findstr "8123"
to see if it is in use (not found). - Used cports application to see if it is in use (not found).
- Used
netsh interface ipv4 show excludedportrange protocol=tcp
to ensure 8123 is not in any excluded range. - Disabled Hyper-V, still failed so I re-enabled it.
- Checked my system's proxy settings - doesn't look like it is using any proxy:
Here is the error I get when I try to run the legacy application:
System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at http://127.0.0.1:8123/npsharp/localServices/IPos/eb84421f-b4cd-4827-abaa-81327afc36e1/ExecuteAction that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refuse.
I am absolutely at loss for why in the world it cannot connect to this port. The port is not being blocked by firewall, not in use, and not in any excluded range. My machine is not going through any proxy. Is there something I am missing that I have not tried?
Solution 1:
I am absolutely at loss for why in the world it cannot connect to this port. The port is not being blocked by firewall, not in use, and not in any excluded range.
You can't connect to a port where nothing listens. The operating system will simply shrug its virtual shoulders and send you a RST.
To test connectivity, you need something listening on that port. It has to be in use for you to be able to connect to it.
Start your application. Check that it works as expected. If the application doesn't start, look into error messages or logs produced by that application. It's not because it can't bind that port probably.