monero-ecosystem / monero-python

A comprehensive Python module for handling Monero cryptocurrency
BSD 3-Clause "New" or "Revised" License
244 stars 80 forks source link

Proxy socks connections #109

Closed makkiato83 closed 2 years ago

makkiato83 commented 2 years ago

daemon = Daemon(proxy_url='socks5h://127.0.0.1:9150', host='myhiddenMoneroRPCservice.onion', port=18081)

Does not work out of the box after the:

pip install -r requirements.txt -r test_requirements_py3.txt

I had to also install:

pip install requests requests[socks]

Perhaps worth adding to the requirements?

emesik commented 2 years ago

Does it mean the base version of requests don't support it?

makkiato83 commented 2 years ago

Hi @emesik (great work btw, thanks!)

After pip install -r requirements' I have the followingpip list`:

certifi            2021.10.8
cffi               1.15.0
charset-normalizer 2.0.12
idna               3.3
ipaddress          1.0.23
pip                22.0.4
pycparser          2.21
pycryptodomex      3.14.1
PyNaCl             1.5.0
requests           2.27.1
setuptools         49.2.1
six                1.16.0
urllib3            1.26.9
varint             1.0.2

After further installing the socks pip install requests[socks] I do get:

certifi            2021.10.8
cffi               1.15.0
charset-normalizer 2.0.12
idna               3.3
ipaddress          1.0.23
pip                22.0.4
pycparser          2.21
pycryptodomex      3.14.1
PyNaCl             1.5.0
PySocks            1.7.1
requests           2.27.1
setuptools         49.2.1
six                1.16.0
urllib3            1.26.9
varint             1.0.2

Notice the added PySocks 1.7.1.

So my guess is that it would be enough to add this to the requirements.txt file.