When you connect to a service, you need a host name and a port number. In case of a web service, the first part of the URL contains he host name, and implicitly the protocol specifies the port number (port 80 for http and port 443 for https is the default but can be overridden in the URL). The CONNECTION_REFUSED is given when the host is accessible, but there is no service responding on the port. This could for example be that the service is down, or a network device is not letting traffic though that port.