Example #1
0
class SocksProxy(IPC_Process):
    timeout = 60
    
    def __init__(self, hub_ref, forward_match):
        super(SocksProxy, self).__init__()
        self.hub_ref = hub_ref
        self.forward_match = forward_match
        self.process = None
        
        confdata = self.hub_ref.get('confdata')
        self.proxy_ip = confdata['socks_proxy_ip']
        self.proxy_port = confdata['socks_proxy_port']
        
        
    def run(self):
        self.relayfactory = SmartRelayFactory(self.forward_match, self.timeout)
        self.proxy = SocksServer(self.proxy_ip, self.proxy_port, self.relayfactory)
        self.proxy.run()
        
    def IPC_update_forward_match(self, forward_match):
        self.forward_match = forward_match
        self.relayfactory.set_match(self.forward_match)
        
    def IPC_addr(self):
        return (str(self.proxy_ip), self.proxy_port)
    
    def IPC_url(self):
        return "socks5://%s:%d" % (str(self.proxy_ip), self.proxy_port)
    
        
        
        
Example #2
0
class SocksProxy(IPC_Process):
    timeout = 60

    def __init__(self, hub_ref, forward_match):
        super(SocksProxy, self).__init__()
        self.hub_ref = hub_ref
        self.forward_match = forward_match
        self.process = None

        confdata = self.hub_ref.get('confdata')
        self.proxy_ip = confdata['socks_proxy_ip']
        self.proxy_port = confdata['socks_proxy_port']

    def run(self):
        self.relayfactory = SmartRelayFactory(self.forward_match, self.timeout)
        self.proxy = SocksServer(self.proxy_ip, self.proxy_port,
                                 self.relayfactory)
        self.proxy.run()

    def IPC_update_forward_match(self, forward_match):
        self.forward_match = forward_match
        self.relayfactory.set_match(self.forward_match)

    def IPC_addr(self):
        return (str(self.proxy_ip), self.proxy_port)

    def IPC_url(self):
        return "socks5://%s:%d" % (str(self.proxy_ip), self.proxy_port)
Example #3
0
class SocksProxy(ActorProcess):
    timeout = 60

    def __init__(self, coordinator, matcher):
        super(SocksProxy, self).__init__()
        self.coordinator = coordinator
        self.matcher = matcher

        confdata = self.coordinator.get('confdata')
        self.ip = confdata['socks_proxy_ip']
        self.port = confdata['socks_proxy_port']

    def run(self):
        init_logging()
        self.relayfactory = FireflyRelayFactory(self.matcher, self.timeout)
        self.proxy = SocksServer(self.ip, self.port, self.relayfactory)
        self.proxy.run()

    def IPC_addr(self):
        return (self.ip, self.port)

    def IPC_update_matcher(self, matcher):
        self.matcher = matcher
        self.relayfactory.set_matcher(matcher)

    def IPC_url(self):
        return "socks5://%s:%d" % (str(self.ip), self.port)
Example #4
0
class SocksProxy(ActorProcess):
    timeout = 60

    def __init__(self, coordinator, matcher):
        super(SocksProxy, self).__init__()
        self.coordinator = coordinator
        self.matcher = matcher

        confdata = self.coordinator.get("confdata")
        self.ip = confdata["socks_proxy_ip"]
        self.port = confdata["socks_proxy_port"]

    def run(self):
        init_logging()
        self.relayfactory = FireflyRelayFactory(self.matcher, self.timeout)
        self.proxy = SocksServer(self.ip, self.port, self.relayfactory)
        self.proxy.run()

    def IPC_addr(self):
        return (self.ip, self.port)

    def IPC_update_matcher(self, matcher):
        self.matcher = matcher
        self.relayfactory.set_matcher(matcher)

    def IPC_url(self):
        return "socks5://%s:%d" % (str(self.ip), self.port)