Let's say I got 100.000 different hidden services all connecting to localhost on port 8080.

Would there be a way for my server to know which service the connection came from? Maybe by looking up the port number used by the socket and check with Tor which service created it? Is something like that possible using the tor control protocol?

I know it's a silly scenario, but I do wonder about this. The idea is to have a different hidden service address for each user of my server (which would be invite only). Then I could easily mitigate DoS attacks by just disabling the address the traffic is coming from.

Or is there a way to just get data about the incoming traffic volume coming from my services?

1 Answer 1


I guess the easiest way would be one of:

  1. Use separate port number for each hidden service and have your server listen on all of them;
  2. Use separate ip address on loopback / dummy device for each hidden service.

This was you have unambiguous mapping from hidden service name to either target port or target address.

  • That's basically what I came up with yesterday (made a proof of concept test), it felt like a "dirty" solution though, hence why I hoped there would be a nicer way. :) Sep 12, 2020 at 15:46

You must log in to answer this question.

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