First off, I'm not very familiar with networking concepts, so apologies in advance if I butcher something.
I'm attempting to set up a socks5 proxy for making programmatic requests to a particular server. Now, I understand that I can have one terminal window where I locally type torpy_socks -p 1050 --hops 3 in order to create a new circuit, and then indicate the proxy list thus:
I'm wondering, however, if it's possible to set up a fresh circuit (i.e., essentially run torpy_socks -p 1050 --hops 3 again after killing the initial circuit) programmatically, if a particular condition is met (e.g., if a counter reaches 5).
Again, sorry if this was phrased poorly, but hopefully it's made sense so far!
Edit: I've understood that executing command line commands using os.system('some_code') would work to create the circuit initially, but I'd like to know if it's possible to kill and restart that particular process from within the same script.
First off, I'm not very familiar with networking concepts, so apologies in advance if I butcher something.
I'm attempting to set up a socks5 proxy for making programmatic requests to a particular server. Now, I understand that I can have one terminal window where I locally type
torpy_socks -p 1050 --hops 3
in order to create a new circuit, and then indicate the proxy list thus:proxies_list = { 'http': 'socks5://user:pass@127.0.0.1:1050', 'https': 'socks5://user:pass@127.0.0.1:1050' }
requests.get("http://httpbin.org/ip", proxies= proxies_list)
I'm wondering, however, if it's possible to set up a fresh circuit (i.e., essentially run
torpy_socks -p 1050 --hops 3
again after killing the initial circuit) programmatically, if a particular condition is met (e.g., if a counter reaches 5).Again, sorry if this was phrased poorly, but hopefully it's made sense so far!
Edit: I've understood that executing command line commands using
os.system('some_code')
would work to create the circuit initially, but I'd like to know if it's possible to kill and restart that particular process from within the same script.