dar6k6night
@dar6k6night
Веб разработка, скрипты

Python ошибка при подключении к proxy ipv6?

на третьем питоне есть такой код
import requests
proxies = {
'http': "socks5://login:pass@ip:port",
'https': "socks5://login:pass@ip:port"
}
s = requests.Session()
s.proxies = proxies
s.get("google.ru")

вылетает ошибка, подскажите в каком направлении копать
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/site-packages/socks.py", line 813, in connect
negotiate(self, dest_addr, dest_port)
File "/usr/lib/python3/dist-packages/site-packages/socks.py", line 477, in _negotiate_SOCKS5
CONNECT, dest_addr)
File "/usr/lib/python3/dist-packages/site-packages/socks.py", line 552, in _SOCKS5_request
raise SOCKS5Error("{0:#04x}: {1}".format(status, error))
socks.SOCKS5Error: 0x05: Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/site-packages/requests/packages/urllib3/contrib/socks.py", line 88, in _new_conn
**extra_kw
File "/usr/lib/python3/dist-packages/site-packages/socks.py", line 239, in create_connection
raise err
File "/usr/lib/python3/dist-packages/site-packages/socks.py", line 229, in create_connection
sock.connect((remote_host, remote_port))
File "/usr/lib/python3/dist-packages/site-packages/socks.py", line 96, in wrapper
return function(*args, **kwargs)
File "/usr/lib/python3/dist-packages/site-packages/socks.py", line 817, in connect
raise GeneralProxyError("Socket error", error)
socks.GeneralProxyError: Socket error: 0x05: Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/lib/python3/dist-packages/site-packages/requests/packages/urllib3/connectionpool.py", line 356, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3/dist-packages/http/client.py", line 1106, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3/dist-packages/http/client.py", line 1151, in _send_request
self.endheaders(body)
File "/usr/lib/python3/dist-packages/http/client.py", line 1102, in endheaders
self._send_output(message_body)
File "/usr/lib/python3/dist-packages/http/client.py", line 934, in _send_output
self.send(msg)
File "/usr/lib/python3/dist-packages/http/client.py", line 877, in send
self.connect()
File "/usr/lib/python3/dist-packages/site-packages/requests/packages/urllib3/connection.py", line 166, in connect
conn = self._new_conn()
File "/usr/lib/python3/dist-packages/site-packages/requests/packages/urllib3/contrib/socks.py", line 110, in _new_conn
"Failed to establish a new connection: %s" % error
requests.packages.urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: 0x05: Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/site-packages/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/lib/python3/dist-packages/site-packages/requests/packages/urllib3/connectionpool.py", line 649, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/lib/python3/dist-packages/site-packages/requests/packages/urllib3/util/retry.py", line 376, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: SOCKSHTTPConnectionPool(host='google.ru', port=80): Max retries exceeded with url: / (Caused by NewConnectionError(': Failed to establish a new connection: 0x05: Connection refused',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3/dist-packages/site-packages/requests/sessions.py", line 501, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3/dist-packages/site-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/site-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3/dist-packages/site-packages/requests/adapters.py", line 487, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: SOCKSHTTPConnectionPool(host='google.ru', port=80): Max retries exceeded with url: / (Caused by NewConnectionError(': Failed to establish a new connection: 0x05: Connection refused',))
  • Вопрос задан
  • 3921 просмотр
Пригласить эксперта
Ответы на вопрос 1
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы