socket.error: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
If you are getting following error when u try to connect HTTP URL using Python code then solution will be not that tough it is given below.
I was try to connect Splunk using python scripts and i got this error. Code which i was running
import splunklib.client as client
HOST = "restapi.splunk.Company.com"
PORT = 8809
USERNAME = "user"
PASSWORD = "pwd"
# Create a Service instance and log in
service = client.connect(
host=HOST,
port=PORT,
username=USERNAME,
password=PASSWORD)
# Print installed apps to the console to verify login
for app in service.indexes:
print app.name
Error popped up: socket.error: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Solution : Change Port number to 443, because default web port number is 443.