6

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.

1
  • The answer about Proxies is correct. Vidalia is jut one interface for viewing the status of Tor, starting and stopping it, etc. arm is another such interface. To connect to the internet through Tor you use the SOCKS4a or SOCKS5 proxy which it provides. You don't have to provide the user with an option to turn that off. Vidalia isn't related to what you want to do.
    – user5
    Commented Oct 14, 2013 at 16:51

3 Answers 3

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.

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:

4
  • No, you're wrong. I want to make queries.
    – Friendly
    Commented Oct 29, 2013 at 14:54
  • Ah, gotcha, in that case you might want to clarify your original question to make it easier for other people to find it (when searching via a search engine for instance).
    – user5
    Commented Oct 29, 2013 at 17:34
  • We maintain jtorctl now in a separate git repo: github.com/guardianproject/jtorctl Commented Sep 16, 2015 at 13:34
  • 1
    @Hans-ChristophSteiner This answer is marked as community wiki, so feel free to update the link :)
    – user5
    Commented Sep 16, 2015 at 17:49
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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .