youandme/src/youandme/tor.py

15 lines
355 B
Python
Raw Normal View History

2020-04-16 11:41:49 +00:00
import stem.process
2020-04-20 08:36:41 +00:00
def launch_tor(control_port="1336", socks_port="1337"):
2020-04-16 11:41:49 +00:00
control_port = str(control_port)
socks_port = str(socks_port)
stem.process.launch_tor_with_config(
config = {
'ControlPort': control_port,
'SocksPort': socks_port,
'Log': [
'NOTICE stdout'
],
}, take_ownership=True)