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
    Commented May 19, 2014 at 8:18
  • @JensKubieziel I edited my question
    – ring0
    Commented May 19, 2014 at 9:51
  • What is your application? is it code? if so c#, java or something else?
    – puser
    Commented May 20, 2014 at 9:18
  • 1
    @ring0 i'd recommend you edit your post to make that more clear.
    – puser
    Commented May 20, 2014 at 12:25
  • 1
    are you asking for a way to use the tor source code and connect that way?
    – puser
    Commented May 20, 2014 at 17:01

2 Answers 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.


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 ( 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)

You must log in to answer this question.

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