I want to create a browser bundle that supports the following things:
there is a standalone tor process that i launch it using the controller connection from the stem library and i manually connect tor-browser to this standalone process by specifying the related environment variables and i have a add-on written using web-extension API that use native messaging for communicating between the native application and the web extension.
is this method the proper way to have our own customized tor browser bundle?
my main point is to generate circuit's that are static during the lifetime of the browser and give our clients functionality to select their desired country for entry and middle and exit relays. for these purpose's i am launching the tor process using a specific config(for static circuits) and using stem to prevent tor from attaching streams to circuits by itself and i do it manually(for using our custom generated circuits). the first problem i have is that attaching streams to circuits manually is not a stable and reliable solution according to my experiment. the suggested code for this according to the stem documentation:
circuit_id = controller.new_circuit(path, await_build = True)
def attach_stream(stream): if stream.status == 'NEW': controller.attach_stream(stream.id, circuit_id)
controller.add_event_listener(attach_stream, stem.control.EventType.STREAM)
the second problem is that i need my circuit's to be static and for that i am using these command-line options to launch my tor process:
config = { 'SocksPort': str(SOCKS_PORT)+' '+'IsolateSOCKSAuth'+' '+'KeepAliveIsolateSOCKSAuth', 'ControlPort': str(CONTROL_PORT), 'CircuitsAvailableTimeout':'86400', 'NewCircuitPeriod':'86400', 'MaxCircuitDirtiness':'86400', 'DirAuthorityFallbackRate':'0', 'KeepalivePeriod':'60' },
from my point of knowledge this config should make my circuits to be available for 24 hours, but the actual period that my circuit is available is far far less than idle(something about 10 minutes or less).
i really appreciate if you guys help me to fix these issues, especially the second one. thank u