[英]New identity with TOR and Stem
Stem officials docs says that new identity is established by the following: 干官员的文档说,新身份是由以下人员建立的:
from stem import Signal
from stem.control import Controller
with Controller.from_port(port = 9051) as controller:
controller.authenticate()
controller.signal(Signal.NEWNYM)
And below is my code: 下面是我的代码:
import urllib2
from stem import Signal
from stem.control import Controller
def connect():
with Controller.from_port(port=9051) as controller:
controller.authenticate(my_pass)
controller.signal(Signal.NEWNYM)
for i in range(5):
connect()
print urllib2.urlopen('http://icanhazip.com/').read().strip()
However the ip address does not change. 但是,ip地址不会更改。
ps. ps。 Yes, I've edited the
torrc
file. 是的,我已经编辑了
torrc
文件。
p2. p2。 I am aware of this and that threads.
我知道这个和那个线程。
Any ideas? 有任何想法吗?
您将不得不等到新的nym可用: if controller.is_newnym_available(): controller.signal(Signal.NEWNYM)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.