def connect(self): tor = None if self.use_tor: tor = yield get_tor(reactor) if not tor: raise TorError("Could not connect to a running Tor daemon") self._wormhole = wormhole.create(APPID, RELAY, reactor, tor=tor) logging.debug("Connecting to %s (tor=%s)...", RELAY, tor) welcome = yield self._wormhole.get_welcome() logging.debug("Connected to wormhole server; got welcome: %s", welcome) self.got_welcome.emit(welcome)
def start_tor(self): self._tor = yield get_tor(self._reactor, launch_tor=False, tor_control_port=self._tor_port, timing=self._timing) return