Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
Bumped by Community user
Bumped by Community user
s/TOR/Tor/
Source Link
user5
user5

Running parallel TORTor servers with different exit IPs with nodejs app

    # 10 seconds is the shortest refresh time allowed by TORTor.
    MaxCircuitDirtiness 10

    # puts a listener on localhost:9050
    SOCKSPort 9050
    ControlPort 9051
    DataDirectory /var/lib/tor_0

    # some policies of which I dont know they are important
    SOCKSPolicy accept 192.168.0.0/16
    SOCKSPolicy accept 127.0.0.0/8
    SOCKSPolicy accept6 FC00::/7
    SOCKSPolicy reject *

Running parallel TOR servers with different exit IPs with nodejs app

    # 10 seconds is the shortest refresh time allowed by TOR.
    MaxCircuitDirtiness 10

    # puts a listener on localhost:9050
    SOCKSPort 9050
    ControlPort 9051
    DataDirectory /var/lib/tor_0

    # some policies of which I dont know they are important
    SOCKSPolicy accept 192.168.0.0/16
    SOCKSPolicy accept 127.0.0.0/8
    SOCKSPolicy accept6 FC00::/7
    SOCKSPolicy reject *

Running parallel Tor servers with different exit IPs with nodejs app

    # 10 seconds is the shortest refresh time allowed by Tor.
    MaxCircuitDirtiness 10

    # puts a listener on localhost:9050
    SOCKSPort 9050
    ControlPort 9051
    DataDirectory /var/lib/tor_0

    # some policies of which I dont know they are important
    SOCKSPolicy accept 192.168.0.0/16
    SOCKSPolicy accept 127.0.0.0/8
    SOCKSPolicy accept6 FC00::/7
    SOCKSPolicy reject *
Source Link

Running parallel TOR servers with different exit IPs with nodejs app

I have a small node app that makes requests via Tor. My goal is to have a different exit IP for every request. in the torrc configuration file one can set MaxCircuitDirtiness 10, which will make it change exit ip every 10 seconds. This is the minimum value that can be imposed. However, if I want to make 1 request/second, this is not enough.

So I am figuring out how to configure & run multiple tor servers such that I have different exit IPs, which is already discussed here. But it just doesn't seem to work. Someone already mentions this in a comment on the accepted answer.

I have followed all steps: I have in my case 4 torrc files with seperate ports, 4 datadirectories (permissions are fixed), I start 4 different Tor servers all loading different config files.

I wrote a small app in nodejs to show that it doesn't work.

    var Agent   = require('socks5-https-client/lib/Agent');
    var request = require('request');
    var cheerio = require('cheerio');
    var url = "https://check.torproject.org/"
    function makereq(port){
        request({
            url: url,
            strictSSL: true,
            agentClass: Agent,
            agentOptions: {
                socksHost: '127.0.0.1',
                socksPort: port
            }
        }, function(err, res) {
            if (err == null){
                $ = cheerio.load(res.body)
                var ip = $('p strong').text()
                console.log("Request through PORT " + port + " with EXIT IP "+ ip)
            }
            else {
                console.log("Something went wrong")
                console.log(err)
            }
        });
    }

    var ports = [9050, 9060, 9070, 9080];
    counter = 0
    setInterval(function(){
        makereq(ports[counter])
        counter++
        if (counter == ports.length){
            counter = 0
        }
    }, 1000)

Naturally, my question: how do I get this set-up to work? How do I get different exit IPs for seperate Tor servers?

For completeness, one of the torrc files

    # 10 seconds is the shortest refresh time allowed by TOR.
    MaxCircuitDirtiness 10

    # puts a listener on localhost:9050
    SOCKSPort 9050
    ControlPort 9051
    DataDirectory /var/lib/tor_0

    # some policies of which I dont know they are important
    SOCKSPolicy accept 192.168.0.0/16
    SOCKSPolicy accept 127.0.0.0/8
    SOCKSPolicy accept6 FC00::/7
    SOCKSPolicy reject *