def setup_nodes(self):
    self.have_ipv6 = test_ipv6_local()
    self.conf1 = Socks5Configuration()
    self.conf1.addr = ('127.0.0.1', (RANGE_BEGIN + (os.getpid() % 1000)))
    self.conf1.unauth = True
    self.conf1.auth = False
    self.conf2 = Socks5Configuration()
    self.conf2.addr = ('127.0.0.1', ((RANGE_BEGIN + 1000) + (os.getpid() % 1000)))
    self.conf2.unauth = True
    self.conf2.auth = True
    if self.have_ipv6:
        self.conf3 = Socks5Configuration()
        self.conf3.af = socket.AF_INET6
        self.conf3.addr = ('::1', ((RANGE_BEGIN + 2000) + (os.getpid() % 1000)))
        self.conf3.unauth = True
        self.conf3.auth = True
    else:
        self.log.warning('Testing without local IPv6 support')
    self.serv1 = Socks5Server(self.conf1)
    self.serv1.start()
    self.serv2 = Socks5Server(self.conf2)
    self.serv2.start()
    if self.have_ipv6:
        self.serv3 = Socks5Server(self.conf3)
        self.serv3.start()
    args = [['-listen', ('-proxy=%s:%i' % self.conf1.addr), '-proxyrandomize=1'], ['-listen', ('-proxy=%s:%i' % self.conf1.addr), ('-onion=%s:%i' % self.conf2.addr), '-proxyrandomize=0'], ['-listen', ('-proxy=%s:%i' % self.conf2.addr), '-proxyrandomize=1'], []]
    if self.have_ipv6:
        args[3] = ['-listen', ('-proxy=[%s]:%i' % self.conf3.addr), '-proxyrandomize=0', '-noonion']
    self.add_nodes(self.num_nodes, extra_args=args)
    self.start_nodes()
def setup_nodes(self):
    self.have_ipv6 = test_ipv6_local()
    self.conf1 = Socks5Configuration()
    self.conf1.addr = ('127.0.0.1', (RANGE_BEGIN + (os.getpid() % 1000)))
    self.conf1.unauth = True
    self.conf1.auth = False
    self.conf2 = Socks5Configuration()
    self.conf2.addr = ('127.0.0.1', ((RANGE_BEGIN + 1000) + (os.getpid() % 1000)))
    self.conf2.unauth = True
    self.conf2.auth = True
    if self.have_ipv6:
        self.conf3 = Socks5Configuration()
        self.conf3.af = socket.AF_INET6
        self.conf3.addr = ('::1', ((RANGE_BEGIN + 2000) + (os.getpid() % 1000)))
        self.conf3.unauth = True
        self.conf3.auth = True
    else:
        self.log.warning('Testing without local IPv6 support')
    self.serv1 = Socks5Server(self.conf1)
    self.serv1.start()
    self.serv2 = Socks5Server(self.conf2)
    self.serv2.start()
    if self.have_ipv6:
        self.serv3 = Socks5Server(self.conf3)
        self.serv3.start()
    args = [['-listen', ('-proxy=%s:%i' % self.conf1.addr), '-proxyrandomize=1'], ['-listen', ('-proxy=%s:%i' % self.conf1.addr), ('-onion=%s:%i' % self.conf2.addr), '-proxyrandomize=0'], ['-listen', ('-proxy=%s:%i' % self.conf2.addr), '-proxyrandomize=1'], []]
    if self.have_ipv6:
        args[3] = ['-listen', ('-proxy=[%s]:%i' % self.conf3.addr), '-proxyrandomize=0', '-noonion']
    self.add_nodes(self.num_nodes, extra_args=args)
    self.start_nodes()