Ejemplo n.º 1
0
class HostManager(HostManagerBase):
    def __init__(self, config, logger):
        self.config = config
        self.logger = logger
        self.appid_manager = None

        self.sni_manager = SniManager(logger)

    def get_host(self):
        if not self.appid_manager:
            return ""

        appid = self.appid_manager.get()
        if not appid:
            self.logger.warn("no appid")
            time.sleep(10)
            raise Exception()

        return appid + ".appspot.com"

    def get_sni_host(self, ip):
        sni = self.sni_manager.get()
        host = self.get_host()

        return sni, host
Ejemplo n.º 2
0
class HostManager(HostManagerBase):
    def __init__(self, config, logger):
        self.config = config
        self.logger = logger
        self.appid_manager = None

        self.sni_manager = SniManager(logger)

    def get_host(self):
        if not self.appid_manager:
            return ""

        appid = self.appid_manager.get()
        if not appid:
            self.logger.warn("no appid")
            time.sleep(10)
            raise Exception()

        return appid + ".appspot.com"

    def get_sni_host(self, ip):
        sni = self.sni_manager.get()
        host = self.get_host()

        # IPv4 is dead
        #if not host:
        #    sni = self.sni_manager.get()
        #else:
        #    sni = host

        return sni, host
Ejemplo n.º 3
0
class HostManager(HostManagerBase):
    def __init__(self, config, logger):
        self.config = config
        self.logger = logger
        self.appid_manager = None

        self.sni_manager = SniManager(logger)

    def get_sni_host(self, ip):
        if not self.appid_manager:
            raise Exception()

        sni = self.sni_manager.get()
        appid = self.appid_manager.get()
        if not appid:
            self.logger.warn("no appid")
            time.sleep(10)
            raise Exception()

        top_domain = appid + ".appspot.com"
        return sni, top_domain
Ejemplo n.º 4
0
    def __init__(self, config, logger):
        self.config = config
        self.logger = logger
        self.appid_manager = None

        self.sni_manager = SniManager(logger)
Ejemplo n.º 5
0
    def __init__(self, config, logger):
        self.config = config
        self.logger = logger
        self.appid_manager = None

        self.sni_manager = SniManager(logger)