[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-dev] Summer 2017 Internship to Create a Bridge Bandwidth Scanner



> Also, I agree with Tim. The present wording makes it sound like
> txtorcon is the only game in town when it comes to custom circuit
> construction.

I looked at the "to russia with love" examples, but I don't see how you
map particular streams to circuits?

The last example on the page it seems like you're just "really hoping"
that the next stream to open is the one you want to map onto the new
circuit, or am I missing something? That is, what if you had 2 custom
circuits and 2 streams to open? Or what if some other client used your
Tor at that moment to make a connetion?

To plug the newest txtorcon API (the "Tor" object): this provides really
simple support for both "raw" TCP connections and specifically Web
connections (via Twisted's built-in Agent or treq, the "requests-like
API for Twisted") routed over Tor (on custom circuits or
otherwise). This all uses the source-ports of the streams to determine
which ones to map to which circuits. So, you can safely have thousands
of custom streams in-flight on any number of different custom circuits
(and play nicely with other clients using the same tor instance).

For example, "use any Tor circuit and make a Web request":

   https://github.com/meejah/txtorcon/blob/master/examples/web_client_treq.py#L23

vs. "build a custom circuit and make a request over that":

   https://github.com/meejah/txtorcon/blob/master/examples/web_client_custom_circuit.py#L35

Cheers,

-- 
meejah
_______________________________________________
tor-dev mailing list
tor-dev@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev