7

I want to have a program I'm writing interact with the Internet exclusively through Tor. After perusing the Tor project's documentation it appears that they do not specify the API anywhere i.e. how a program can talk to Vidalia to access the Internet through Tor. This is much talk about proxies but I don't care about that approach. I don't want to have the option of using the Internet without Tor. I only want to use Tor. Where is the API? Thanks.

bastik
  • 2,684
  • 18
  • 28
Friendly
  • 225
  • 3
  • 4

3 Answers3

6

To have your program use the Internet through Tor, just teach it to use Tor as a SOCKS4a or a SOCKS5 proxy.

The Wikipedia page on SOCKS should have the information you need.

nickm
  • 361
  • 2
  • 3
5

While nickm's answer of "Use SOCKS, that's what it's there for" is correct, I think you might be asking the wrong question. If you want to get information about other aspects of Tor, but don't want to perform queries, implement SOCKS, etc. yourself, you can always use one of the existing libraries. In Python, for instance, you can use Stem.

If you're wanting to control Tor yourself, you can read up on the control protocol.

I've marked this answer CW; if anyone knows other API's designed for interacting with Tor please list them below:

m894v5n74v539nm8
  • 324
  • 2
  • 17
3

For a tutorial on client usage through tor see here. Stem is one of the most feature complete controller libraries, but there's certainly others available too.

Damian
  • 681
  • 3
  • 2