Thanks James, this is awesome! Very well done. Out of curiosity why sidestep any use of Stem? It supports encoding/decoding most tor cell types...
Yours: https://github.com/torpyorg/torpy/blob/master/torpy/cells.py Mine: https://gitweb.torproject.org/stem.git/tree/stem/client/cell.py
If you'd care to integrate any of this functionality into Stem I'd be delighted to work with you.
Cheers! -Damian
On Thu, Oct 17, 2019 at 7:05 AM James Brown jbrown299@yandex.com wrote:
Hello all,
Recently I finished a pure python implementation of the Tor client. It's called torpy (https://github.com/torpyorg/torpy).
It offers handy API, supports v2 hidden services with "basic" and "stealth" authorization protocol. Works with python 3.6+. It has no dependencies on the original C Tor client and Stem. For more information please take a look at README on github.
Here is a quick example of how to use the library:
from torpy import TorClient hostname = 'ifconfig.me' # or onion-services as well, for example 'http://facebookcorewwwi.onion' tor = TorClient() # Choose random guard node and create 3-hops circuit with tor.create_circuit(3) as circuit: # Create tor stream to host with circuit.create_stream((hostname, 80)) as stream: # Now we can communicate with host stream.send(b'GET / HTTP/1.0\r\nHost: %s\r\n\r\n' % hostname.encode()) recv = stream.recv(1024)
Please list torpy project at https://trac.torproject.org/projects/tor/wiki/doc/ListOfTorImplementations
It would be nice if you try the client. I look forward to any feedback.
Cheers.
tor-dev mailing list tor-dev@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev
Hi Damian,
Sorry for the late reply.
There are two things why I didn't use Stem.
1. A number of python implementations I've found on the internet had broken dependencies or didn't work at all. So, I decided to create a fully functional Tor client with the bare minimum of dependencies.
2. Up until now I thought Stem was just a library to control the Tor process. As it said at front of https://stem.torproject.org: "With it you can use Tor's control protocol to script against the Tor process". Unfortunately API docs didn't help me to see that certain Tor primitives were indeed implemented.
If you'd care to integrate any of this functionality into Stem I'd be delighted to work with you.
I didn't yet think about integration. It's always a matter of spare time. Anyway, you can freely use the code or send me bugs. In turn, I can help you to resolve the issues.
Cheers.
- A number of python implementations I've found on the internet had
broken dependencies or didn't work at all. So, I decided to create a fully functional Tor client with the bare minimum of dependencies.
Ah! Gotcha. For what it's worth I'm in complete agreement with you on that. I designed Stem to avoid any hard dependencies [1] for the exact same reason.
- Up until now I thought Stem was just a library to control the Tor
process. As it said at front of https://stem.torproject.org: "With it you can use Tor's control protocol to script against the Tor process". Unfortunately API docs didn't help me to see that certain Tor primitives were indeed implemented.
Makes sense. Stem's client functionality is relatively new. I implemented enough to download descriptors [2], but there's still a lot of room to grow [3].
Cheers! -Damian
[1] https://stem.torproject.org/faq.html#does-stem-have-any-dependencies [2] https://gitweb.torproject.org/stem.git/commit/?id=820881a [3] https://2019.www.torproject.org/getinvolved/volunteer.html.en#pythonTorClien...
Hi pls help me to join your technical team
On Wed, 23 Oct 2019, 2:57 am Damian Johnson, atagar@torproject.org wrote:
- A number of python implementations I've found on the internet had
broken dependencies or didn't work at all. So, I decided to create a fully functional Tor client with the bare minimum of dependencies.
Ah! Gotcha. For what it's worth I'm in complete agreement with you on that. I designed Stem to avoid any hard dependencies [1] for the exact same reason.
- Up until now I thought Stem was just a library to control the Tor
process. As it said at front of https://stem.torproject.org: "With it you can use Tor's control protocol to script against the Tor process". Unfortunately API docs didn't help me to see that certain Tor primitives were indeed implemented.
Makes sense. Stem's client functionality is relatively new. I implemented enough to download descriptors [2], but there's still a lot of room to grow [3].
Cheers! -Damian
[1] https://stem.torproject.org/faq.html#does-stem-have-any-dependencies [2] https://gitweb.torproject.org/stem.git/commit/?id=820881a [3] https://2019.www.torproject.org/getinvolved/volunteer.html.en#pythonTorClien... _______________________________________________ tor-dev mailing list tor-dev@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev