meejah / txtorcon

Twisted-based asynchronous Tor control protocol implementation. Includes unit-tests, examples, state-tracking code and configuration abstraction.
http://fjblvrw2jrxnhtg67qpbzi45r7ofojaoo3orzykesly2j3c2m3htapid.onion/
MIT License
250 stars 72 forks source link

Embed Tor as a python module starting in a python thread to avoid starting a "process" #49

Closed fpietrosanti closed 11 years ago

fpietrosanti commented 11 years ago

This ticket is to provide a different approach to start Tor from within txtorcon by using a custom patched Tor version.

The idea is to enable building desktop application with a modern language like HTML5/CSS3 supported by TideSDK that support extending application with Python, including binary modules: http://tidesdk.multipart.net/docs/user-dev/generated/#!/guide/using_python

So, if "Tor process" would be compiled with the minor modifications to be embeddable as a python module (i'd say as a txtorconn module), it would be possible to make desktop application including Tor as a python module extending TideSDK.

The very same approach has been used by CovertBrowser in order to run Tor as a thread on iPhone, because an iPhone application cannot run "multiple executable" .

What do you think?

meejah commented 11 years ago

I have certainly thought of having bits of tor as a library (e.g. the parsing code). It's an interesting idea, but I really doubt that txtorcon is the right place for this -- if it happens, it seems likely that txtorcon could be changed a little to interface with it, but the first thing would be making this hypothetical tor shared library.

Since I see there's already some discussion on tor-dev about this, I'm going to close the bug here until there's a library somewhere.

p.s. I've never heard of TideSDK before, but a (very) quick perusal shows they have an API to launch a process -- is this not sufficient? You couldn't use "txtorcon.launch_tor", but you could launch one and immediately connect to it using txtorcon via the Tide stuff, I seems...