Python - Controlling Tor

前端 未结 3 692
礼貌的吻别
礼貌的吻别 2020-12-29 12:41

I\'m attempting to control Tor with Python. I\'ve read a couple of the other questions asked about this subject on stackoverflow but none of them answer this question.

3条回答
  •  伪装坚强ぢ
    2020-12-29 12:57

    Well, out of luck I managed to find a PHP script that did the exact same thing I wanted, and with the help of that I converted it to work in TorCtl. This is what it looks like for anyone else needing it in the future!

    from TorCtl import TorCtl
    
    conn = TorCtl.connect(controlAddr="127.0.0.1", controlPort=9051, passphrase="123")
    
    TorCtl.Connection.send_signal(conn, "NEWNYM")
    

提交回复
热议问题