5

I want to incorporate Tor in my application in order to access a Tor hidden service. Make GET POST requests to the web server.

Is there any resource I can read to implement a simple Tor client that will allow me to send requests to a webservice ?

  • 2
    Could you elaborate a bit, what you mean by Tor library? What exactly do you want to achieve? – Jens Kubieziel May 19 '14 at 8:18
  • @JensKubieziel I edited my question – ring0 May 19 '14 at 9:51
  • What is your application? is it code? if so c#, java or something else? – puser May 20 '14 at 9:18
  • 1
    @ring0 i'd recommend you edit your post to make that more clear. – puser May 20 '14 at 12:25
  • 1
    are you asking for a way to use the tor source code and connect that way? – puser May 20 '14 at 17:01
2

For the protocol you should have a look at the tor specs.

If you understand Java you can also have a look at orchid or SilverTunnel-NG or just have a look at the tor codebase itself.

5

Tor is a socks5 proxy.

here is the socks5 rfc

here is a guide to how socks5 works with tor read this, it is VERY useful

if using sockets (I assume c++ uses sockets) you will need to

  1. connect to tor (127.0.0.1:9050 by default)
  2. Send authentication (5,1,0) see rfc part 3
  3. Receive the tor response (5,0) see rfc part 3
  4. Send Client's Connection request (5,1,0,3 + host length + a binary representation of the host and port) see rfc part 4
  5. receive the tor response (5,0,0,1,0,0,0,0,0,0) see rfc part 6 (there can be a bunch of errors here, so watch out)
  6. Send a binary representation of a http request to tor (Tor will forward this to the destination)
  7. Receive the http response (will send the header first then the web page)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.