Simply trying to access en.wikipedia.org with a python script where a huge stack of dependencies prevents configuring a proxy (would take a year in order to rewrite dependencies for getting proxy support especially since some of the dependencies like https://pypi.org/project/websocket-client/ or https://pypi.org/project/aiohttp/ don’t support socks proxies).
So I thought I could use torsocks/torify
but :
1652642569 ERROR torsocks[327]: [socks5] Resolve destination buffer too small (in socks5_recv_resolve_reply() at socks5.c:701)
2022-05-15 21:22:49,723 - BatchWorkExecutor [ERROR] - An exception occurred while executing work_handler.
Traceback (most recent call last):
File "/usr/lib/pypy3.9/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
File "/usr/lib/pypy3.9/site-packages/urllib3/util/connection.py", line 72, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/lib64/pypy3.9/socket.py", line 954, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
_socket.gaierror: [Errno -4] Non-recoverable failure in name resolution
This means an ɪᴘv6 address is being attempted to be written in the space for an ɪᴘv4 address and can be reproduced with curl :
$ torify curl https://rpc.ethermine.org
1653212429 ERROR torsocks[599]: [socks5] Resolve destination buffer too small (in socks5_recv_resolve_reply() at socks5.c:701)
curl: (6) Could not resolve host: rpc.ethermine.org
How to prevent torsocks from receiving an ɪᴘv6 address on name resolution ? Is it possible to configure tor to not only disable ɪᴘv6 connectivity, but ɪᴘv6 name resolution too ?