How to change the Tor exit node programmatically to get a new IP?

前端 未结 11 1215
别跟我提以往
别跟我提以往 2020-12-07 10:41

I have Tor running on my computer, and I need to change the Tor exit node every five minutes. For example, if I start using Tor via some exit node, then in 5 minutes I want

11条回答
  •  情书的邮戳
    2020-12-07 11:15

    If you don't have access to the control port, you could use a different circuit which changes your IP*. This can be done by specifying a different socks username:

    $ curl -x "socks5://circuit1@127.0.0.1:9050" "https://ifconfig.io/ip"
    109.70.100.34
    
    $ curl -x "socks5://circuit2@127.0.0.1:9050" "https://ifconfig.io/ip"
    209.222.101.251
    
    $ curl -x "socks5://circuit3@127.0.0.1:9050" "https://ifconfig.io/ip"
    54.37.19.83
    

    If you want to reuse a specific IP at some point you can use the same username you used before to get that IP again.

    * The exit node will be random every time and there is a slight chance you'll get the same IP twice in a row.

    Correct me if I'm wrong, I'm not a Tor expert, but this works for me.

提交回复
热议问题