[tor-dev] Stem ORPort protocol support
atagar at torproject.org
Wed Feb 7 20:23:49 UTC 2018
Hi all. Over the last few months Tim and I have been collaborating on
Python support for the ORPort protocol. With it you can download
descriptors without a DirPort, and possibly fancier things in the
future like full circuit construction.
Tim put together a wonderful proof of concept called Endosome...
... and I just finished integrating it into Stem...
With stem.client you can now download descriptors...
with stem.client.Relay.connect('127.0.0.1', 12345, ) as relay:
circ = relay.create_circuit()
circ.send('RELAY_BEGIN_DIR', stream_id = 1)
desc = circ.send('RELAY_DATA', 'GET /tor/server/authority
HTTP/1.0\r\n\r\n', stream_id = 1).data
When run this looks like...
% python demo.py
HTTP/1.0 200 OK
Date: Wed, 07 Feb 2018 18:42:41 GMT
Expires: Fri, 09 Feb 2018 18:42:41 GMT
router Unnamed 18.104.22.168 12345 0 23456
-----BEGIN ED25519 CERT-----
-----END ED25519 CERT-----
I'd like to emphasize this is still very alpha. The API isn't set in
stone and there's no doubt quite a few rough edges. However, I wanted
the list to be aware just in case anyone would care to build on it. I
plan to draw a line at 'download descriptors through ORPorts' but I'd
be delighted to help others if there's more ambitious directions
they'd care to go (potentially all the way up to a Python Tor client,
similar to Orchid).
Now that we've reached this milestone I'm taking a break to focus on
Stem support for v3 Onion Services for a bit. However, when I come
back the next things on my dance card are...
a. Support ORPort downloads in the stem.descriptor.remote module.
b. More integ tests so Stem can be used as a tool for testing tor's ORPort.
c. Give more thought to the API we'd like to vend.
d. Brainstorm a GSoC project idea that expands these capabilities.
More information about the tor-dev