Is it possible to create hidden service with django?

Is it possible to create a Tor Hidden Service in Python (Django) or Ruby (Rails)?

  • All the Tor Hidden Services seem to be written in PHP or just plain HTML. If this is possible, is there any reason not to do it? How would one go about doing it?

  • Answer:

    Yes, you can use any tools you want to run hidden services. On the https://www.torproject.org/docs/tor-hidden-service.html.en for Step 1 you can use any webserver stack that suits your needs.

user1189 at Tor Visit the source

Was this solution helpful to you?

Other answers

You can use any programming language for a hidden service. The reason why most of the hidden services using PHP might be the same why many services in the web use PHP. ;) Your hidden service basically needs to listen on some TCP port. This can be for instance a webserver. Your application takes the request from that webserver and does something with it. You can also use the infamous Python example: python -m SimpleHTTPServer to service sites via hidden services. So basically you write your application like you did it using no hidden services. When you are finished, you just tell Tor to forward the requests from the hidden service to the service you are running: HiddenServicePort 80 127.0.0.1:80. Each request which arrives at port 80 of your hidden service is mapped to port 80 on your machine. So when your hidden service also has a public address and serves the same service on that address, a client will get the same answer on the public way as on the hidden service way. It does not depend on programming languages.

Jens Kubieziel

The latest txtorcon supports endpoint-strings, so you can use Twisted built-in Web server to host any WSGI Web application (and twistd comes with SystemD support too). See here: http://txtorcon.readthedocs.org/en/latest/howtos.html#endpoints-enable-tor-with-any-twisted-service The command-line would look something like: twistd web --port onion:hiddenServiceDir=/tmp/something --wsgi my.app.Main (or just "onion:80" for the port to create a new ephemeral hidden-serivce with keys in $TMP)

meejah

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.