[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-dev] New python Tor client implementation



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:
```python
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@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev