Traceback (most recent call last):
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\socks.py", line 851, in connect
negotiate(self, dest_addr, dest_port)
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\socks.py", line 497, in _negotiate_SOCKS5
self, CONNECT, dest_addr)
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\socks.py", line 523, in _SOCKS5_request
chosen_auth = self._readall(reader, 2)
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\socks.py", line 331, in _readall
raise GeneralProxyError("Connection closed unexpectedly")
socks.GeneralProxyError: Connection closed unexpectedly
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\contrib\socks.py", line 88, in _new_conn
**extra_kw
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\socks.py", line 262, in create_connection
raise err
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\socks.py", line 252, in create_connection
sock.connect((remote_host, remote_port))
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\socks.py", line 100, in wrapper
return function(*args, **kwargs)
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\socks.py", line 855, in connect
raise GeneralProxyError("Socket error", error)
socks.GeneralProxyError: Socket error: Connection closed unexpectedly
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\connectionpool.py", line 343, in _make_request
self._validate_conn(conn)
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\connectionpool.py", line 839, in _validate_conn
conn.connect()
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\connection.py", line 301, in connect
conn = self._new_conn()
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\contrib\socks.py", line 110, in _new_conn
"Failed to establish a new connection: %s" % error
urllib3.exceptions.NewConnectionError: <urllib3.contrib.socks.SOCKSHTTPSConnection object at 0x00000144ECC57A90>: Failed to establish a new connection: Connection closed unexpectedly
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\adapters.py", line 449, in send
timeout=timeout
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\urllib3\util\retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: SOCKSHTTPSConnectionPool(host='ifconfig.co', port=443): Max retries exceeded with url: /ip (Caused by NewConnectionError('<urllib3.contrib.socks.SOCKSHTTPSConnection object at 0x00000144ECC57A90>: Failed to establish a new connection: Connection closed unexpectedly',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\terno\Desktop\HOOKER.py", line 3, in <module>
r = requests.get('https://ifconfig.co/ip', proxies=proxies)
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "C:\Users\terno\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: SOCKSHTTPSConnectionPool(host='ifconfig.co', port=443): Max retries exceeded with url: /ip (Caused by NewConnectionError('<urllib3.contrib.socks.SOCKSHTTPSConnection object at 0x00000144ECC57A90>: Failed to establish a new connection: Connection closed unexpectedly',))
Никита Терновой, во-первых, это уже другой вопрос. Во-вторых, почему бы вам не забить в translate.google.com текст ошибки "Connection closed unexpectedly"?
Никита Терновой, значит, что соединение неожиданно закрылось. Ваша программа не знает причин. Может быть прокси-сервер отверг соединение, может быть сервер ifconfig.co отверг соединение, может какой-нибудь из пары десятков маршрутизаторов на пути от вашего компьютера к серверу ifconfig.co его оборвал.