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

Navin Francis navin.kurupacheril at gmail.com
Mon Apr 1 20:17:11 UTC 2013


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20130401/d9de51f7/attachment.html>


More information about the tor-dev mailing list