meejah / txtorcon

Twisted-based asynchronous Tor control protocol implementation. Includes unit-tests, examples, state-tracking code and configuration abstraction.
http://fjblvrw2jrxnhtg67qpbzi45r7ofojaoo3orzykesly2j3c2m3htapid.onion/
MIT License
251 stars 72 forks source link

"find a tor" for client-side "tor:" endpoints #128

Open meejah opened 9 years ago

meejah commented 9 years ago

If a user currently uses a "tor:" client-side endpoint, it currently just tries 9050 and 9150 as SOCKS endpoints. This isn't sufficient, nor particularly safe.

What it should do instead is something like the server-side ("onion:") endpoints, and do the following:

  1. if get_global_tor ever got called, use that tor we launched (adding a SOCKS port if needed)
  2. try connecting to 9151 as a control-port (and ask for the SOCKS port(s))
  3. try connecting to 9051 as a control port (ask for SOCKS ports)
  4. call get_global_tor() ourselves, thus launching one.
david415 commented 9 years ago

yes and if the endpoint descriptor string specifies a socks port then only that socks port should be used; here i'm thinking of people who use sandboxing to isolate various application... they might prefer an application to use a specific instance of tor.