def establish_connection(self, server): self.ovpn_dict = utils.create_server_dict(self.server_dict[server], self.protocol_dict) if self.hop_server_dict is not None: self.ovpn_dict.update({"hop": "2"}) else: self.ovpn_dict.update({"hop": "0"}) self.kill() self.qomui_service.connect_to_server(self.ovpn_dict) config = self.get_config() try: if config["bypass"] == 1: self.qomui_service.bypass(utils.get_user_group()) except KeyError: pass
def set_hop(self, server): self.hop_server_dict = utils.create_server_dict( self.server_dict[server], self.protocol_dict) self.qomui_service.set_hop(self.hop_server_dict)