[tor-dev] Embedding tor in an application and using tor without opening a port

Fabio Pietrosanti (naif) lists at infosecurity.ch
Mon Apr 1 20:25:18 UTC 2013


On 4/1/13 10:17 PM, Navin Francis wrote:
> I am making a small application that always uses tor to communicate. I
> have embedded tor into the application by compiling and linking the
> tor source code along with my own code and calling tor's main() from
> within my own main(). To send data, tor has to open a port on the
> machine and my application would have to send data to 127.0.0.1:port
>
> This seems a little unnecessary since both tor and my application run
> in the same process. More importantly, it seems like any program on
> the machine can use my application's embedded tor client by connecting
> to the right port. 
>
> The easiest way to avoid opening a port seems to be to modify the
> socket implementation so that it accesses an array rather than
> sending/receiving data.
>
> Are there any existing applications that embed tor in this manner? Is
> there a better way to do this, and if not, are there any corner cases
> I have to watch out for?
You are the 3rd person in less than 1 week asking about "using tor
without having tor running .

You may consider the discussion on "Using Tor as a Library"  on Tor-dev
in past week about the idea to make Tor be able to work as a library:
https://lists.torproject.org/pipermail/tor-dev/2013-March/004564.html
https://lists.torproject.org/pipermail/tor-dev/2013-March/004571.html

Let's Cc Waldo that's working on that concept.

Fabio


More information about the tor-dev mailing list