示例#1
0
    def __init__(self):
        try:
            managedInfo = init(transports.transports.keys())
        except EnvException:
            log.warn("Client managed-proxy protocol failed.")
            return

        log.debug("pyptlib gave us the following data:\n'%s'",
                  pprint.pformat(managedInfo))

        for transport in managedInfo['transports']:
            ok, addrport = self.launchClient(
                transport, managedInfo)  # XXX start using exceptions
            if ok:
                log.debug("Successfully launched '%s' at '%s'" %
                          (transport, str(addrport)))
                reportSuccess(transport, 4, addrport, None,
                              None)  # XXX SOCKS v4 hardcoded
            else:
                log.info("Failed to launch '%s'" % transport)
                reportFailure(transport, 'Failed to launch')

        reportEnd()

        log.info("Starting up the event loop.")
        reactor.run()
示例#2
0
def do_managed_client():
    should_start_event_loop = False

    try:
        managedInfo = init(transports.transports.keys())
    except EnvError, err:
        log.warning("Client managed-proxy protocol failed (%s)." % err)
        return
示例#3
0
    def __init__(self):
        try:
            managedInfo = init(transports.transports.keys())
        except EnvException:
            log.warn("Client managed-proxy protocol failed.")
            return

        log.debug("pyptlib gave us the following data:\n'%s'", pprint.pformat(managedInfo))

        for transport in managedInfo['transports']:
            ok, addrport = self.launchClient(transport, managedInfo) # XXX start using exceptions
            if ok:
                log.debug("Successfully launched '%s' at '%s'" % (transport, str(addrport)))
                reportSuccess(transport, 4, addrport, None, None) # XXX SOCKS v4 hardcoded
            else:
                log.info("Failed to launch '%s'" % transport)
                reportFailure(transport, 'Failed to launch')

        reportEnd()

        log.info("Starting up the event loop.")
        reactor.run()