- connection.connect((ip, port))
- LOGGER.debug('%s:%s is reachable!', ip, port)
+ connection = socket.socket()
+ connection.settimeout(10)
+ url = urllib.parse.urlparse(endpoint)
+ port = url.port
+ if not port:
+ port = 443 if url.scheme == "https" else 80
+ connection.connect((url.hostname, port))
+ LOGGER.debug('%s:%s is reachable!', url.hostname, port)