[tor-dev] TOR C# application
michael at briarproject.org
Wed Dec 17 08:28:03 UTC 2014
-----BEGIN PGP SIGNED MESSAGE-----
I don't know if it's possible to use Tor as a library, but there are a
few Java apps that communicate over Tor by launching a Tor process and
using it as a SOCKS proxy. Does that sound like what you're aiming to do?
Here's a quick rundown of what you need to do:
1. Compile tor.exe from source, or copy it from the latest Tor Browser
Bundle (your app won't need to execute the Tor Browser).
2. Launch tor.exe from within your app, using command-line arguments
to pass the location of the config file and the PID of the controlling
process (i.e. your app). The complete command will look something like
/path/to/tor.exe -f /path/to/config __OwningControllerProcess <pid>
3. Control tor.exe via the local control port using the Tor control
protocol. There's a Java library that implements this protocol, but I
don't know of a C# library, so you may need to write your own using
the Java library as guidance. You can set the control port in the
config file so it doesn't conflict with the Tor Browser.
You should use the AUTHENTICATE command to prevent other apps from
accessing the control port, and the TAKEOWNERSHIP command to ensure
tor.exe exits when your app exits.
4. Communicate over Tor by connecting to the local SOCKS port. You can
set this port in the config file so it doesn't conflict with the Tor
Here's some Java source code that may be useful for guidance:
All of the above are based on Orbot by the Guardian Project:
On 15/12/14 15:51, Hollow Quincy wrote:
> Hi all,
> I would like to write a C# application (IRC client) that is using
> TOR. I read a lot, but I still don't know how can I run TOR proxy
> in transparent way (from my c# code).
> I see that Tor Stem (https://stem.torproject.org/) can be used by
> Python code or there are packages for Linux, but not C# (.NET).
> How can I run Tor proxy from C# ? Is there a library (dll) that I
> can run ? (without need to have open Tor Bundle browser).
> Thanks for help _______________________________________________
> tor-dev mailing list tor-dev at lists.torproject.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the tor-dev