Esempio n. 1
0
    def __init__(self, my_peer, endpoint, network):
        super(MultiProxy, self).__init__(my_peer, endpoint, network)
        self.peers_dict = {}
        self.be_server = False
        self.tunnel = False
        self.socks5_factory = Socks5Factory(self)
        self.forward_factory = ForwardFactory(self)
        self.server_factory = ServerFactory(self)

        self.open_socks5_server()

        self.settings = TunnelSettings()
        self.settings.become_exitnode = False

        self.port = self.endpoint.get_address()[1]
        if not self.be_server:
            reactor.listenTCP(self.port, self.forward_factory)
            self.logger.debug("Forwarder is listening on port: {}".format(
                self.port))
        else:
            reactor.listenTCP(self.port, self.server_factory)
            self.logger.debug("Server is listening on port: {}".format(
                self.port))

        if self.tunnel:
            self.tunnel_data()
Esempio n. 2
0
 def __init__(self, my_peer, endpoint, network):
     super(MultiProxyClient, self).__init__(my_peer, endpoint, network)
     self.settings = TunnelSettings()
     self.settings.become_exitnode = False
     self.forward_factory = ForwardFactory(self)
     self._balance = 0
     reactor.listenTCP(self.port, self.forward_factory)
Esempio n. 3
0
 def __init__(self, my_peer, endpoint, network):
     super(MultiProxyServer, self).__init__(my_peer, endpoint, network)
     self.settings = TunnelSettings()
     self.settings.become_exitnode = True
     self.server_factory = ServerFactory(self)
     reactor.listenTCP(self.port, self.server_factory)
     self.logger.debug("{}:{}, {} initialized at {}".format(
         self.addr, self.port, self.__class__.__name__, self.socks5_port))
Esempio n. 4
0
 def __init__(self, my_peer, endpoint, network):
     super(MultiProxyClient, self).__init__(my_peer, endpoint, network)
     self.settings = TunnelSettings()
     self.remove_tunnel_delay = 1000
     self.max_joined_circuits = 1000
     self.settings.become_exitnode = False
     self.forward_factory = ForwardFactory(self)
     reactor.listenTCP(self.port, self.forward_factory)
Esempio n. 5
0
    def __init__(self, my_peer, endpoint, network):
        super(MultiProxy, self).__init__(my_peer, endpoint, network)
        self.peers_dict = {}
        self.socks5_factory = Socks5Factory(self)
        self.forward_factory = ForwardFactory(self)
        self.server_factory = ServerFactory(self)

        self.open_socks5_server()

        self.settings = TunnelSettings()
        self.settings.become_exitnode = False
        # self.choose_identity(("client", 3))

        self.build_tunnels(2)
Esempio n. 6
0
 def __init__(self, my_peer, endpoint, network):
     super(MyCommunity, self).__init__(my_peer, endpoint, network)
     self.settings = TunnelSettings()
     self.settings.become_exitnode = False
     self.nodes = {}