Tor browser, new IP not working?

六月ゝ 毕业季﹏ 提交于 2019-12-02 10:40:32

To use Python to request a new IP for every request, you need to open a connection to the ControlPort and issue a NEWNYM signal.

You can use Stem to simplify the connection and commands:

from stem.control import Controller
from stem import Signal

if __name__ == '__main__':
  with Controller.from_port(port = 9051) as controller:
    controller.authenticate('password')  # provide the password here if you set one

    controller.signal(Signal.NEWNYM) # switch to clean circuits

Keep in mind Tor may rate limit NEWNYM requests so you may need to wait a short while (default 10 seconds) before issuing that command. Also, due to the limited number of exit nodes, your circuits might get the same exit node depending on how many requests you are issuing.

You need to issue this command every time you want to get a new IP (switch circuits).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!