<div dir="ltr"><div>Hello all,</div><div><br></div><div>I am a PhD student, and am working on some measurements in Tor.</div><div>I am stuck at a point where i need to send multiple applications(streams) traffic through a single circuit.</div><div>I am currently using torsocks/torify to send traffic of these multiple applications through Tor.</div><div>The
 main problem is that, despite trying many different ways to achieve the
 same (sending multiple streams through a single circuit), i am not 
successful.</div><div><br></div><div>Things i have tried :</div><div>1.)
 Force Tor process to create only a single circuit at a time preventing 
any new circuit creation, so that any new stream would be attached to 
this only available circuit. To acheive this i have set the following 
Tor options : <br></div><div>set __DisablePredictedCircuits to 1<br>set MaxClientCircuitsPending to 1<br>set newcircuitperiod to 999999999<br>set maxcircuitdirtiness to 999999999</div><div>The
 problem with the above method is that it seems to work sometimes 
randomly. But most of the times for some reason, a new circuit is still 
created.</div><div><br></div><div>2.) Next, i assumed that maybe running
 torify multiple times for each application is the culprit, as it may 
try to create new circuit for each run. So i created a new bidirectional
 stream using socat, which listens on a local TCP port, and forwards the
 data to the Tor SOCKS port assuming that it will lead to a singe 
connection to local SOCKS.<br></div><div>Even this did not work and still new circuits were created randomly.  <br></div><div><br></div><div>3.)
 Next i tried to attach streams to circuits manually, using the stem 
library following the link : 
<a href="https://stem.torproject.org/tutorials/to_russia_with_love.html#custom-path-selection">https://stem.torproject.org/tutorials/to_russia_with_love.html#custom-path-selection</a>
 . This seemed to work initially, but then after every 4-5 runs, the 
streams seemed to detach automatically. Moreover, the original circuit 
crashed too.</div><div><br></div><div>It would be great, if someone 
could tell a simple way to achieve the same, or would point me to any 
mistakes that can be improved in the above methodologies to make them 
work.<br></div><div><br></div><div><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Regards<br><br></div>Piyush</div></div></div></div></div></div></div></div></div>