def __init__(self, user, token=None): if token: self.token = token else: self.token = unique_id() self.user = user self.expiration_time = now() + timedelta(hours=24)
def __init__( self, user, token=None): if token: self.token = token else: self.token = unique_id() self.user = user self.expiration_time = now() + timedelta(hours=24)
def __init__(self, config): for option in ["manage_dynamic_proxy", "dynamic_proxy_bind_port", "dynamic_proxy_bind_ip", "dynamic_proxy_debug", "dynamic_proxy_external_proxy", "dynamic_proxy_prefix", "proxy_session_map", "dynamic_proxy", "cookie_path", "dynamic_proxy_golang_noaccess", "dynamic_proxy_golang_clean_interval", "dynamic_proxy_golang_docker_address", "dynamic_proxy_golang_api_key"]: setattr(self, option, getattr(config, option)) if self.manage_dynamic_proxy: self.lazy_process = self.__setup_lazy_process(config) else: self.lazy_process = NoOpLazyProcess() if self.dynamic_proxy_golang_api_key is None: self.dynamic_proxy_golang_api_key = unique_id() self.proxy_ipc = proxy_ipc(config)